Add scripts to run Cosmos tests on a container#37110
Add scripts to run Cosmos tests on a container#37110AndriySvyryd wants to merge 4 commits intomainfrom
Conversation
84dfcc5 to
9a72c4a
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Pull request overview
This PR configures the Cosmos DB emulator to use port 8800 specifically for Helix CI runs and adds a mechanism to skip connection checks to prevent tests from being skipped when the emulator is not immediately available.
Changes:
- Adds a
SkipConnectionCheckconfiguration flag that bypasses connection availability checks - Configures Helix Windows builds to use port 8800 for the Cosmos emulator and skip connection checks
- Simplifies the GitHub Actions Cosmos test workflow by combining restore, build, and test into a single command
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| test/EFCore.Cosmos.FunctionalTests/TestUtilities/TestEnvironment.cs | Adds SkipConnectionCheck property to read configuration for bypassing connection checks |
| test/EFCore.Cosmos.FunctionalTests/TestUtilities/CosmosTestStore.cs | Updates IsConnectionAvailableAsync to return true immediately when SkipConnectionCheck is enabled |
| eng/helix.proj | Adds Cosmos test configuration for Windows Helix queues with port 8800 and connection check skip |
| .github/workflows/TestCosmos.yaml | Simplifies workflow by combining build and test steps, adds SkipConnectionCheck environment variable |
|
The tests are now failing with |
249ae47 to
6b86657
Compare
Pull request was converted to draft
857aad5 to
162a9e2
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 31 out of 31 changed files in this pull request and generated 8 comments.
You can also share your feedback on Copilot code review. Take the survey.
test/EFCore.Cosmos.FunctionalTests/TestUtilities/TestEnvironment.cs
Outdated
Show resolved
Hide resolved
test/EFCore.Cosmos.FunctionalTests/TestUtilities/LinuxEmulatorSaveChangesInterceptor.cs
Show resolved
Hide resolved
7ad563e to
61aef7c
Compare
Don't skip tests if emulator not available
61aef7c to
dba485a
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 44 out of 44 changed files in this pull request and generated 4 comments.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 44 out of 44 changed files in this pull request and generated 4 comments.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 44 out of 44 changed files in this pull request and generated 2 comments.
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 44 out of 44 changed files in this pull request and generated 2 comments.
You can also share your feedback on Copilot code review. Take the survey.
| - `eng/testing/run-cosmos-container.ps1` | ||
| - `eng/testing/run-cosmos-container.sh` | ||
|
|
||
| These scripts can be invoked locally for testing on machines that don't have the emulator installed, but have docker available. |
There was a problem hiding this comment.
Instead of this, we should consider automatically spinning up the emulator via a testcontainer when there isn't an environment variable pointing to an external instance (like #37809 does for SQL Server).
Ideally we'd also either detect that it's the Linux emulator rather than requiring an explicit env var for this (no idea how, maybe some sort of Cosmos version function?? Or otherwise if the connection string points to localhost and we're not in Windows?), or maybe do the env var the other way (assume it's Linux unless otherwise).
This point is to have everything just always working out of the box, so that the repo can be checked out on any machine, the tests executed, and everything to be green.
But we can make these improvements later too, if you prefer.
Run Cosmos tests on a Linux container emulator in Helix
Don't skip tests if emulator not available
Make the Cosmos emulator available for Copilot
Fixes #19973