3838 miscChanged : ${{ steps.filter.outputs.misc }}
3939 functionsChanged : ${{ steps.filter.outputs.functions }}
4040 azureAiChanged : ${{ steps.filter.outputs.azure-ai }}
41+ cosmosChanged : ${{ steps.filter.outputs.cosmos }}
4142 steps :
4243 - uses : actions/checkout@v6
4344 - uses : dorny/paths-filter@v3
6768 - 'python/packages/durabletask/**'
6869 azure-ai:
6970 - 'python/packages/azure-ai/**'
71+ cosmos:
72+ - 'python/packages/azure-cosmos/**'
7073 # run only if 'python' files were changed
7174 - name : python tests
7275 if : steps.filter.outputs.python == 'true'
@@ -390,6 +393,64 @@ jobs:
390393
391394 # TODO: Add python-tests-lab
392395
396+ # Azure Cosmos integration tests
397+ python-tests-cosmos :
398+ name : Python Tests - Cosmos Integration
399+ needs : paths-filter
400+ if : >
401+ github.event_name != 'pull_request' &&
402+ needs.paths-filter.outputs.pythonChanges == 'true' &&
403+ (github.event_name != 'merge_group' ||
404+ needs.paths-filter.outputs.cosmosChanged == 'true' ||
405+ needs.paths-filter.outputs.coreChanged == 'true')
406+ runs-on : ubuntu-latest
407+ environment : integration
408+ services :
409+ cosmosdb :
410+ image : mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:vnext-preview
411+ ports :
412+ - 8081:8081
413+ env :
414+ AZURE_COSMOS_ENDPOINT : " http://localhost:8081/"
415+ # Static Azure Cosmos DB emulator key (documented): https://learn.microsoft.com/en-us/azure/cosmos-db/emulator
416+ AZURE_COSMOS_KEY : " C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw=="
417+ AZURE_COSMOS_DATABASE_NAME : " agent-framework-cosmos-it-db"
418+ AZURE_COSMOS_CONTAINER_NAME : " agent-framework-cosmos-it-container"
419+ defaults :
420+ run :
421+ working-directory : python
422+ steps :
423+ - uses : actions/checkout@v6
424+ - name : Set up python and install the project
425+ id : python-setup
426+ uses : ./.github/actions/python-setup
427+ with :
428+ python-version : ${{ env.UV_PYTHON }}
429+ os : ${{ runner.os }}
430+ - name : Wait for Cosmos DB emulator
431+ run : |
432+ for i in {1..60}; do
433+ if curl --silent --show-error http://localhost:8081/ > /dev/null; then
434+ echo "Cosmos DB emulator is ready."
435+ exit 0
436+ fi
437+ sleep 2
438+ done
439+ echo "Cosmos DB emulator did not become ready in time." >&2
440+ exit 1
441+ - name : Test with pytest (Cosmos integration)
442+ run : uv run --directory packages/azure-cosmos poe integration-tests -n logical --dist worksteal --timeout=120 --session-timeout=900 --timeout_method thread --retries 2 --retry-delay 5
443+ working-directory : ./python
444+ - name : Surface failing tests
445+ if : always()
446+ uses : pmeier/pytest-results-action@v0.7.2
447+ with :
448+ path : ./python/**.xml
449+ summary : true
450+ display-options : fEX
451+ fail-on-empty : false
452+ title : Cosmos integration test results
453+
393454 python-integration-tests-check :
394455 if : always()
395456 runs-on : ubuntu-latest
@@ -401,6 +462,7 @@ jobs:
401462 python-tests-misc-integration,
402463 python-tests-functions,
403464 python-tests-azure-ai,
465+ python-tests-cosmos,
404466 ]
405467 steps :
406468 - name : Fail workflow if tests failed
0 commit comments