Skip to content

Commit 9ca2787

Browse files
committed
CosmosDB emulator tests
1 parent 4b46140 commit 9ca2787

File tree

16 files changed

+112
-102
lines changed

16 files changed

+112
-102
lines changed

eng/templates/jobs/ci-emulator-tests.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,11 @@ jobs:
7575
eng/scripts/test-setup.sh
7676
displayName: 'Install test python extension, dependencies and the worker'
7777
condition: or(eq(variables.isExtensionsRelease, true), eq(variables['USETESTPYTHONEXTENSIONS'], true))
78+
- bash: |
79+
docker pull mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:vnext-preview
80+
docker run --detach --publish 8081:8081 --publish 1234:1234 mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:vnext-preview
81+
docker ps
82+
displayName: "Start CosmosDB Emulator"
7883
- bash: |
7984
docker compose -f workers/tests/emulator_tests/utils/eventhub/docker-compose.yml pull
8085
docker compose -f workers/tests/emulator_tests/utils/eventhub/docker-compose.yml up -d
@@ -84,6 +89,7 @@ jobs:
8489
env:
8590
AzureWebJobsStorage: "UseDevelopmentStorage=true"
8691
AzureWebJobsEventHubConnectionString: "Endpoint=sb://localhost;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true;"
92+
AzureWebJobsCosmosDBConnectionString: "AccountEndpoint=http://localhost:8081/;AccountKey=C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw==;"
8793
workingDirectory: $(Build.SourcesDirectory)/workers
8894
displayName: "Running $(PYTHON_VERSION) Python Linux Emulator Tests"
8995
- bash: |

workers/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Repository = "https://github.com/Azure/azure-functions-python-worker"
5050

5151
[project.optional-dependencies]
5252
dev = [
53+
"azure-cosmos", # Used for CosmosDB Emulator tests
5354
"azure-eventhub", # Used for EventHub E2E tests
5455
"azure-functions-durable", # Used for Durable E2E tests
5556
"azure-monitor-opentelemetry; python_version >= '3.8'", # Used for Azure Monitor unit tests

0 commit comments

Comments
 (0)