diff --git a/.github/workflows/TestCosmos.yaml b/.github/workflows/TestCosmos.yaml index c99b80cd438..4b57d2c748f 100644 --- a/.github/workflows/TestCosmos.yaml +++ b/.github/workflows/TestCosmos.yaml @@ -34,6 +34,8 @@ jobs: - name: Test on Cosmos run: dotnet test test/EFCore.Cosmos.FunctionalTests/EFCore.Cosmos.FunctionalTests.csproj shell: cmd + env: + Test__Cosmos__SkipConnectionCheck: true - name: Publish Test Results uses: actions/upload-artifact@v6 diff --git a/eng/helix.proj b/eng/helix.proj index 81c6772d101..4bc1c3ec083 100644 --- a/eng/helix.proj +++ b/eng/helix.proj @@ -13,6 +13,7 @@ true true $(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 + $(RepoRoot)/test/EFCore.Cosmos.FunctionalTests/*.csproj; @@ -70,7 +71,14 @@ - + + + + + + $(PreCommands);set Test__Cosmos__SkipConnectionCheck=true;set Test__Cosmos__DefaultConnection=https://localhost:8800 + + $(NetCurrent) diff --git a/test/EFCore.Cosmos.FunctionalTests/TestUtilities/CosmosTestStore.cs b/test/EFCore.Cosmos.FunctionalTests/TestUtilities/CosmosTestStore.cs index b4ef5fa0749..051afa33262 100644 --- a/test/EFCore.Cosmos.FunctionalTests/TestUtilities/CosmosTestStore.cs +++ b/test/EFCore.Cosmos.FunctionalTests/TestUtilities/CosmosTestStore.cs @@ -96,6 +96,11 @@ public override DbContextOptionsBuilder AddProviderOptions(DbContextOptionsBuild public static async ValueTask IsConnectionAvailableAsync() { + if (TestEnvironment.SkipConnectionCheck) + { + return true; + } + if (_connectionAvailable == null) { await _connectionSemaphore.WaitAsync(); diff --git a/test/EFCore.Cosmos.FunctionalTests/TestUtilities/TestEnvironment.cs b/test/EFCore.Cosmos.FunctionalTests/TestUtilities/TestEnvironment.cs index 37c0d2d4d0a..a95ba1fb899 100644 --- a/test/EFCore.Cosmos.FunctionalTests/TestUtilities/TestEnvironment.cs +++ b/test/EFCore.Cosmos.FunctionalTests/TestUtilities/TestEnvironment.cs @@ -46,4 +46,6 @@ public static class TestEnvironment : Enum.Parse(Config["AzureLocation"]); public static bool IsEmulator { get; } = !UseTokenCredential && (AuthToken == _emulatorAuthToken); + + public static bool SkipConnectionCheck { get; } = Config["SkipConnectionCheck"] == "true"; }