Add Linux workflow for testing with Cosmos DB emulator docker container (current and vnext)#197
Add Linux workflow for testing with Cosmos DB emulator docker container (current and vnext)#197
Conversation
Co-authored-by: philnach <19275540+philnach@users.noreply.github.com>
…nectivity checks Co-authored-by: philnach <19275540+philnach@users.noreply.github.com>
philnach
left a comment
There was a problem hiding this comment.
Change looks good and verified works by running the action.
|
@copilot, the vnext Cosmos DB emulator is in preview see: https://learn.microsoft.com/en-us/azure/cosmos-db/emulator-linux. Can you update the PR to also run against the vnet emulator, but don't fail if the tests don't past? |
The tests target the emulator through environment variables:
This follows the same pattern as the existing Windows workflow (
Updated the workflow to test against both emulator versions using a matrix strategy:
The vnext tests use Commit: 1718e27 |
Co-authored-by: philnach <19275540+philnach@users.noreply.github.com>
|
@copilot, the test is failing because there isn't enough wait time for the container. Can you take a look at the failure and fix it? |
…B emulator Co-authored-by: philnach <19275540+philnach@users.noreply.github.com>
I've identified and fixed the container initialization timeout issue. The vnext emulator container was taking longer than 5 minutes to start, causing the health checks to fail. Changes made in commit 77045dc:
This gives the container up to ~8.7 minutes to become healthy (120s start period + 20 retries × 20s intervals), which should be sufficient for the vnext emulator to fully initialize. |
|
@copilot, the vnext emulator doesn't easily support HTTPS with .net. Can you use http:// protocol when connecting to the vnext emulator. You also cannot download the pem file. This means don't attempt to try and pull down the pem url for the vnext emulator. Also, the vnext emulator has two port configurations the endpoint which is on port 8081 and the explorer port which is on 1234. Can you update the test to target the vnext emulator in this fashion? See this page for more information on the vnext emulator: https://learn.microsoft.com/en-us/azure/cosmos-db/emulator-linux |
Co-authored-by: philnach <19275540+philnach@users.noreply.github.com>
Updated the workflow to support vnext emulator's HTTP-only configuration in commit 2314467: Key changes:
|
Co-authored-by: philnach <19275540+philnach@users.noreply.github.com>
Co-authored-by: philnach <19275540+philnach@users.noreply.github.com>
This PR implements a new GitHub Actions workflow to run Cosmos DB unit tests on Linux using the official Cosmos DB emulator docker containers, enabling Linux developers to perform local testing and development with both current and preview emulator versions.
Changes Made
New Workflow:
.github/workflows/linux-cosmos-emulator-test.ymlKey Features:
ubuntu-latestmcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:latest(HTTPS)mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:vnext-preview(HTTP)https://127.0.0.1:8081/http://127.0.0.1:8081/Protocol-Specific Handling:
Workflow Triggers:
workflow_dispatchExtensions/Cosmos/**)Test Execution:
./Extensions/Cosmos/Cosmos.DataTransfer.CosmosExtension.UnitTests/Performance Optimizations:
Benefits
Testing
The workflow complements the existing
cosmos_db_emulator.yml(Windows) workflow and provides the same testing capabilities for Linux environments with additional coverage for preview emulator versions and protocol-specific handling.💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.