Repository navigation
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>
There was a problem hiding this comment.
Copilot , where do the tests target the emulator?
Phil Nachreiner (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>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4e24c294-5f06-491a-9097-3183ee8b3eff
Merge current main separately, use documented vNext HTTPS readiness and trusted certificates, and retain preview advisory policy. Make configured initialization failures visible and verify both integration results in Linux and Windows CI with negative regression coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4e24c294-5f06-491a-9097-3183ee8b3eff
The stable Linux emulator exceeded the 30-second cleanup deadline after the round-trip assertions passed. Allow two minutes for database deletion while retaining failure propagation and the workflow test timeout. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4e24c294-5f06-491a-9097-3183ee8b3eff
Summary
Add Linux CI coverage for the current and vNext Cosmos DB emulators, with reliable integration-test execution checks. This branch includes current
main(f22439ff9a8e3ae150a9dce2f2cdb4774c1baa34) through a non-history-rewriting merge; no production application code is changed relative to main.Changes
mcr.microsoft.com/cosmosdb/linux/azure-cosmos-emulator:latestand:vnext-latestover HTTPS. The .NET SDK does not support vNext HTTP mode. ConfigurePROTOCOL=https, use Gateway mode, and explicitly disable bulk execution for these JSON round-trip tests. See Microsoft's vNext emulator documentation.http://localhost:8080/readyprobe. Import the certificate into the runner trust store and verify HTTPS without disabling certificate validation for the SDK.continue-on-error. Inspect the actual preview job and test outcomes, not just the overall workflow conclusion.Test_Json_RoundTrip_WithLongValuesandTest_FromJson_WithLongValuesin both Linux and Windows emulator workflows. Missing, duplicate, skipped, or failed results fail the verification step.Verified results
Final pushed commit:
06a3b2e51cb81d3b7c45ea313063782eb14ee01e. Counts below were checked against the downloaded TRX test records, not inferred from workflow status.Local focused Cosmos tests also passed (107 unit tests, 2 expected no-emulator skips), negative cases passed, and both changed workflows passed actionlint.
An earlier repair run surfaced a stable-emulator database cleanup timeout at 30 seconds. The final commit increases that bounded allowance to two minutes without swallowing failures; both subsequent Linux matrix runs passed. The preview still has documented SDK/feature limitations: this validates JSON round trips, not bulk execution or authentication enforcement. Existing compiler/package warnings remain unchanged.
The PR remains draft. No approval, readiness, merge, release, deployment, or publication action was taken.