-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Use port 8800 for Cosmos emulator on Helix #37110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Don't skip tests if emulator not available
84dfcc5 to
9a72c4a
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
| <EnableAzurePipelinesReporter>true</EnableAzurePipelinesReporter> | ||
| <FailOnTestFailure>true</FailOnTestFailure> | ||
| <SqlServerTests>$(RepoRoot)/test/EFCore.SqlServer.FunctionalTests/*.csproj;$(RepoRoot)/test/EFCore.SqlServer.HierarchyId.Tests/*.csproj;$(RepoRoot)/test/EFCore.OData.FunctionalTests/*.csproj;$(RepoRoot)/test/EFCore.AspNet.SqlServer.FunctionalTests/*.csproj;$(RepoRoot)/test/EFCore.VisualBasic.FunctionalTests/*.vbproj</SqlServerTests> | ||
| <CosmosTests>$(RepoRoot)/test/EFCore.Cosmos.FunctionalTests/*.csproj;</CosmosTests> |
Copilot
AI
Jan 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The trailing semicolon after the wildcard pattern is unnecessary and could potentially cause issues with path matching. MSBuild property values typically don't require a trailing semicolon unless multiple values are being concatenated. This should be <CosmosTests>$(RepoRoot)/test/EFCore.Cosmos.FunctionalTests/*.csproj</CosmosTests> without the trailing semicolon.
| <!-- Set Cosmos emulator connection on Windows --> | ||
| <ItemGroup Condition = "'$(HelixTargetQueue.StartsWith(`Windows`))'"> | ||
| <XUnitProject Update="$(CosmosTests)"> | ||
| <PreCommands>$(PreCommands);set Test__Cosmos__SkipConnectionCheck=true;set Test__Cosmos__DefaultConnection=https://localhost:8800</PreCommands> |
Copilot
AI
Jan 12, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PreCommands string is missing spaces after the semicolons between commands. While this may work on Windows (since the semicolon terminates the command), it's better practice to add spaces for readability. Consider: $(PreCommands);set Test__Cosmos__SkipConnectionCheck=true; set Test__Cosmos__DefaultConnection=https://localhost:8800
| <PreCommands>$(PreCommands);set Test__Cosmos__SkipConnectionCheck=true;set Test__Cosmos__DefaultConnection=https://localhost:8800</PreCommands> | |
| <PreCommands>$(PreCommands); set Test__Cosmos__SkipConnectionCheck=true; set Test__Cosmos__DefaultConnection=https://localhost:8800</PreCommands> |
|
The tests are now failing with |
249ae47 to
6b86657
Compare
Don't skip tests if emulator not available
Fixes #19973