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
14 changes: 4 additions & 10 deletions .github/workflows/TestCosmos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,12 @@ jobs:

- name: Checkout
uses: actions/checkout@v5

- 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@v5
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>
</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.Open' OR '$(HelixTargetQueue)' == 'Ubuntu.2204.Amd64'">
<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>
</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