Skip to content

Commit 8eaad40

Browse files
authored
Skip more failing Cosmos tests on the emulator (#38040)
1 parent e0c5251 commit 8eaad40

7 files changed

Lines changed: 37 additions & 6 deletions

File tree

.github/workflows/TestCosmos.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ jobs:
3535
run: dotnet test test/EFCore.Cosmos.FunctionalTests/EFCore.Cosmos.FunctionalTests.csproj
3636
shell: cmd
3737
env:
38-
Test__Cosmos__SkipConnectionCheck: true
38+
Test__Cosmos__DefaultConnection: https://localhost:8081
39+
Test__Cosmos__SkipConnectionCheck: true
3940

4041
- name: Publish Test Results
4142
uses: actions/upload-artifact@v7

azure-pipelines-internal-tests.yml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,31 @@ extends:
161161
demands: ImageOverride -equals 1es-ubuntu-2204
162162
os: linux
163163
variables:
164-
- _runCounter: $[counter(variables['Build.Reason'], 0)]
165164
# Rely on task Arcade injects, not auto-injected build step.
166165
- skipComponentGovernanceDetection: true
167-
- ${{ if notin(variables['Build.Reason'], 'PullRequest', 'Schedule') }}:
168-
- _CosmosConnectionUrl: 'true'
166+
steps:
167+
- template: /eng/common/templates-official/steps/enable-internal-sources.yml
168+
- template: /eng/common/templates-official/steps/enable-internal-runtimes.yml
169+
- script: eng/common/build.sh --restore --build --test --pack --ci --configuration $(_BuildConfig) --prepareMachine $(_InternalRuntimeDownloadArgs)
170+
env:
171+
Test__Cosmos__DefaultConnection: $(_CosmosConnectionUrl)
172+
displayName: Build
173+
templateContext:
174+
sdl:
175+
binskim:
176+
preReleaseVersion: ''
177+
- job: Linux_Cosmos
178+
displayName: 'Linux Cosmos'
179+
condition: notin(variables['Build.Reason'], 'PullRequest', 'Schedule')
180+
timeoutInMinutes: 210
181+
pool:
182+
name: $(DncEngInternalBuildPool)
183+
demands: ImageOverride -equals 1es-ubuntu-2204
184+
os: linux
185+
variables:
186+
- _runCounter: $[counter(variables['Build.Reason'], 0)]
187+
- skipComponentGovernanceDetection: true
188+
- _CosmosConnectionUrl: 'true'
169189
steps:
170190
- bash: |
171191
echo "##vso[task.setvariable variable=_CosmosConnectionUrl]https://ef-nightly-test.documents.azure.com:443/"
@@ -177,11 +197,10 @@ extends:
177197
condition: and(eq(variables['_CosmosConnectionUrl'], 'true'), or(endsWith(variables['_runCounter'], '1'), endsWith(variables['_runCounter'], '3'), endsWith(variables['_runCounter'], '5'), endsWith(variables['_runCounter'], '7'), endsWith(variables['_runCounter'], '9')))
178198
- template: /eng/common/templates-official/steps/enable-internal-sources.yml
179199
- template: /eng/common/templates-official/steps/enable-internal-runtimes.yml
180-
- script: eng/common/build.sh --restore --build --test --pack --ci --configuration $(_BuildConfig) --prepareMachine $(_InternalRuntimeDownloadArgs)
200+
- script: eng/common/build.sh --restore --build --pack --ci --configuration $(_BuildConfig) --prepareMachine $(_InternalRuntimeDownloadArgs)
181201
displayName: Build
182202
- task: AzureCLI@2
183203
displayName: Run Cosmos tests
184-
condition: notin(variables['Build.Reason'], 'PullRequest', 'Schedule')
185204
inputs:
186205
azureSubscription: EFCosmosTesting
187206
addSpnToEnvironment: true

test/EFCore.Cosmos.FunctionalTests/EmbeddedDocumentsTest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,7 @@ public virtual async Task Can_use_non_persisted_properties_owned()
709709
}
710710

711711
[ConditionalFact]
712+
[CosmosCondition(CosmosCondition.IsNotLinuxEmulator)]
712713
public virtual async Task Can_use_non_persisted_properties_complex()
713714
{
714715
var options = await Fixture.CreateOptions(

test/EFCore.Cosmos.FunctionalTests/Query/AdHocComplexTypeQueryCosmosTest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public class AdHocComplexTypeQueryCosmosTest(NonSharedFixture fixture) : AdHocCo
1010
protected override ITestStoreFactory NonSharedTestStoreFactory
1111
=> CosmosTestStoreFactory.Instance;
1212

13+
[CosmosCondition(CosmosCondition.IsNotLinuxEmulator)]
1314
public override async Task Complex_type_equals_parameter_with_nested_types_with_property_of_same_name()
1415
{
1516
await base.Complex_type_equals_parameter_with_nested_types_with_property_of_same_name();

test/EFCore.Cosmos.FunctionalTests/Query/Associations/ComplexProperties/ComplexPropertiesStructuralEqualityCosmosTest.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
namespace Microsoft.EntityFrameworkCore.Query.Associations.ComplexProperties;
55

6+
[CosmosCondition(CosmosCondition.IsNotLinuxEmulator)]
67
public class ComplexPropertiesStructuralEqualityCosmosTest : ComplexPropertiesStructuralEqualityTestBase<ComplexPropertiesCosmosFixture>
78
{
89
public ComplexPropertiesStructuralEqualityCosmosTest(ComplexPropertiesCosmosFixture fixture, ITestOutputHelper outputHelper) : base(fixture)

test/EFCore.Cosmos.FunctionalTests/Query/ComplexTypeQueryCosmosTest.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ FROM root c
9494
""");
9595
});
9696

97+
[CosmosCondition(CosmosCondition.IsNotLinuxEmulator)]
9798
public override Task Complex_type_equals_constant(bool async)
9899
=> CosmosTestHelpers.Instance.NoSyncTest(async, async (async) =>
99100
{
@@ -107,6 +108,7 @@ FROM root c
107108
""");
108109
});
109110

111+
[CosmosCondition(CosmosCondition.IsNotLinuxEmulator)]
110112
public override Task Complex_type_equals_parameter(bool async)
111113
=> CosmosTestHelpers.Instance.NoSyncTest(async, async (async) =>
112114
{
@@ -267,6 +269,7 @@ FROM root c
267269
""");
268270
});
269271

272+
[CosmosCondition(CosmosCondition.IsNotLinuxEmulator)]
270273
public override Task Struct_complex_type_equals_constant(bool async)
271274
=> CosmosTestHelpers.Instance.NoSyncTest(async, async (async) =>
272275
{
@@ -280,6 +283,7 @@ FROM root c
280283
""");
281284
});
282285

286+
[CosmosCondition(CosmosCondition.IsNotLinuxEmulator)]
283287
public override Task Struct_complex_type_equals_parameter(bool async)
284288
=> CosmosTestHelpers.Instance.NoSyncTest(async, async (async) =>
285289
{

test/EFCore.Cosmos.FunctionalTests/Query/ComplexTypeToJsonPropertyQueryCosmosTest.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ FROM root c
9494
""");
9595
});
9696

97+
[CosmosCondition(CosmosCondition.IsNotLinuxEmulator)]
9798
public override Task Complex_type_equals_constant(bool async)
9899
=> CosmosTestHelpers.Instance.NoSyncTest(async, async (async) =>
99100
{
@@ -107,6 +108,7 @@ FROM root c
107108
""");
108109
});
109110

111+
[CosmosCondition(CosmosCondition.IsNotLinuxEmulator)]
110112
public override Task Complex_type_equals_parameter(bool async)
111113
=> CosmosTestHelpers.Instance.NoSyncTest(async, async (async) =>
112114
{
@@ -267,6 +269,7 @@ FROM root c
267269
""");
268270
});
269271

272+
[CosmosCondition(CosmosCondition.IsNotLinuxEmulator)]
270273
public override Task Struct_complex_type_equals_constant(bool async)
271274
=> CosmosTestHelpers.Instance.NoSyncTest(async, async (async) =>
272275
{
@@ -280,6 +283,7 @@ FROM root c
280283
""");
281284
});
282285

286+
[CosmosCondition(CosmosCondition.IsNotLinuxEmulator)]
283287
public override Task Struct_complex_type_equals_parameter(bool async)
284288
=> CosmosTestHelpers.Instance.NoSyncTest(async, async (async) =>
285289
{

0 commit comments

Comments
 (0)