File tree Expand file tree Collapse file tree 3 files changed +16
-1
lines changed
test/EFCore.Cosmos.FunctionalTests/TestUtilities Expand file tree Collapse file tree 3 files changed +16
-1
lines changed Original file line number Diff line number Diff line change 1313 <EnableAzurePipelinesReporter >true</EnableAzurePipelinesReporter >
1414 <FailOnTestFailure >true</FailOnTestFailure >
1515 <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 >
16+ <CosmosTests >$(RepoRoot)/test/EFCore.Cosmos.FunctionalTests/*.csproj;</CosmosTests >
1617 </PropertyGroup >
1718
1819 <PropertyGroup Condition = " '$(SYSTEM_ACCESSTOKEN)' == ''" >
7071 <!-- Remove test projects which requires SqlServer from Ubuntu/OSX. -->
7172 <ItemGroup Condition = " '$(HelixTargetQueue.StartsWith(`OSX`))' OR '$(HelixTargetQueue)' == 'Ubuntu.2204.Amd64.Open' OR '$(HelixTargetQueue)' == 'Ubuntu.2204.Amd64'" >
7273 <XUnitProject Remove =" $(SqlServerTests)" />
73- </ItemGroup >
74+ </ItemGroup >
75+
76+ <!-- Set Cosmos emulator connection on Windows -->
77+ <ItemGroup Condition = " '$(HelixTargetQueue.StartsWith(`Windows`))'" >
78+ <XUnitProject Update =" $(CosmosTests)" >
79+ <PreCommands >$(PreCommands);set Test__Cosmos__SkipConnectionCheck=true;set Test__Cosmos__DefaultConnection="https://localhost:8800"</PreCommands >
80+ </XUnitProject >
81+ </ItemGroup >
7482
7583 <PropertyGroup >
7684 <XUnitPublishTargetFramework >net10.0</XUnitPublishTargetFramework >
Original file line number Diff line number Diff line change @@ -96,6 +96,11 @@ public override DbContextOptionsBuilder AddProviderOptions(DbContextOptionsBuild
9696
9797 public static async ValueTask < bool > IsConnectionAvailableAsync ( )
9898 {
99+ if ( TestEnvironment . SkipConnectionCheck )
100+ {
101+ return true ;
102+ }
103+
99104 if ( _connectionAvailable == null )
100105 {
101106 await _connectionSemaphore . WaitAsync ( ) ;
Original file line number Diff line number Diff line change @@ -46,4 +46,6 @@ public static class TestEnvironment
4646 : Enum . Parse < AzureLocation > ( Config [ "AzureLocation" ] ) ;
4747
4848 public static bool IsEmulator { get ; } = ! UseTokenCredential && ( AuthToken == _emulatorAuthToken ) ;
49+
50+ public static bool SkipConnectionCheck { get ; } = Config [ "SkipConnectionCheck" ] == "true" ;
4951}
You can’t perform that action at this time.
0 commit comments