Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions .github/workflows/TestCosmos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,11 @@ jobs:
- name: Checkout
uses: actions/checkout@v6

- name: Restore
run: restore.cmd
shell: cmd

- name: Build
run: build.cmd /p:Projects=${{ github.workspace }}\test\EFCore.Cosmos.FunctionalTests\EFCore.Cosmos.FunctionalTests.csproj
shell: cmd

- name: Test on Cosmos
run: test.cmd /p:Projects=${{ github.workspace }}\test\EFCore.Cosmos.FunctionalTests\EFCore.Cosmos.FunctionalTests.csproj
run: build.cmd -test /p:Projects=${{ github.workspace }}\test\EFCore.Cosmos.FunctionalTests\EFCore.Cosmos.FunctionalTests.csproj
shell: cmd
env:
Test__Cosmos__SkipConnectionCheck: true

- name: Publish Test Results
uses: actions/upload-artifact@v6
Expand Down
10 changes: 9 additions & 1 deletion eng/helix.proj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
<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>
Copy link

Copilot AI Jan 12, 2026

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.

Copilot uses AI. Check for mistakes.
</PropertyGroup>

<PropertyGroup Condition = "'$(SYSTEM_ACCESSTOKEN)' == ''">
Expand Down Expand Up @@ -70,7 +71,14 @@
<!-- Remove test projects which requires SqlServer from Ubuntu/OSX. -->
<ItemGroup Condition = "'$(HelixTargetQueue.StartsWith(`OSX`))' OR '$(HelixTargetQueue)' == 'Ubuntu.2204.Amd64.XL.Open' OR '$(HelixTargetQueue)' == 'Ubuntu.2204.Amd64.XL'">
<XUnitProject Remove="$(SqlServerTests)"/>
</ItemGroup>
</ItemGroup>

<!-- 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>
Copy link

Copilot AI Jan 12, 2026

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

Suggested change
<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>

Copilot uses AI. Check for mistakes.
</XUnitProject>
</ItemGroup>

<PropertyGroup>
<XUnitPublishTargetFramework>net10.0</XUnitPublishTargetFramework>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ public override DbContextOptionsBuilder AddProviderOptions(DbContextOptionsBuild

public static async ValueTask<bool> IsConnectionAvailableAsync()
{
if (TestEnvironment.SkipConnectionCheck)
{
return true;
}

if (_connectionAvailable == null)
{
await _connectionSemaphore.WaitAsync();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,6 @@ public static class TestEnvironment
: Enum.Parse<AzureLocation>(Config["AzureLocation"]);

public static bool IsEmulator { get; } = !UseTokenCredential && (AuthToken == _emulatorAuthToken);

public static bool SkipConnectionCheck { get; } = Config["SkipConnectionCheck"] == "true";
}
Loading