Skip to content

Commit 77f34af

Browse files
committed
Restore assembly-wide conditions
1 parent 4708548 commit 77f34af

47 files changed

Lines changed: 628 additions & 621 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

NuGet.config

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@
1919
<add key="dotnet11" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet11/nuget/v3/index.json" />
2020
<add key="dotnet11-transport" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet11-transport/nuget/v3/index.json" />
2121
<add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" />
22-
<!-- nuget.org is required for xunit.v3 4.0.0-pre.108 (newer than what dotnet-public mirrors). -->
23-
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
2422
</packageSources>
2523
<disabledPackageSources>
2624
<clear />

eng/Versions.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@
5252
<OpenTelemetryExporterInMemoryVersion>1.15.1</OpenTelemetryExporterInMemoryVersion>
5353
<SQLitePCLRawVersion>3.0.3</SQLitePCLRawVersion>
5454
<SQLite3MCPCLRawBundleVersion>2.3.2</SQLite3MCPCLRawBundleVersion>
55-
<XUnitV3Version>4.0.0-pre.108</XUnitV3Version>
5655
<MicrosoftDotNetXUnitV3ExtensionsVersion>11.0.0-beta.26263.112</MicrosoftDotNetXUnitV3ExtensionsVersion>
56+
<MicrosoftTestingPlatformVersion>2.2.2</MicrosoftTestingPlatformVersion>
5757
</PropertyGroup>
5858

5959
<PropertyGroup Label="Analyzers">

test/Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Import Project="..\Directory.Build.props" />
33

44
<PropertyGroup>
5-
<NoWarn>$(NoWarn);CA1707;1591;xUnit1000;xUnit1003;xUnit1004;xUnit1010;xUnit1013;xUnit1026;xUnit2013;xUnit1024</NoWarn>
5+
<NoWarn>$(NoWarn);CA1707;1591;xUnit1000;xUnit1003;xUnit1004;xUnit1010;xUnit1013;xUnit1026;xUnit2013;xUnit1024;xUnit1051;xUnit1031</NoWarn>
66
<CodeAnalysisRuleSet>$(MSBuildThisFileDirectory)..\rulesets\EFCore.test.ruleset</CodeAnalysisRuleSet>
77
<LangVersion>preview</LangVersion>
88
<NuGetAudit>false</NuGetAudit>
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
// Skip the entire assembly if not on Windows and no external SQL Server is configured
4+
using Microsoft.EntityFrameworkCore.TestUtilities.Xunit;
55

6-
[assembly: SqlServerConfiguredCondition]
6+
// Skip the entire assembly if SQL Server is not available
7+
[assembly: ConditionalAssembly(typeof(SqlServerTestEnvironment), nameof(SqlServerTestEnvironment.SqlServerAvailable))]

test/EFCore.Cosmos.FunctionalTests/EndToEndCosmosTest.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ public class EndToEndCosmosTest(NonSharedFixture fixture) : NonSharedModelTestBa
1616
{
1717

1818
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/292 (Transactional batch limits not enforced)
19-
[ConditionalFact(typeof(CosmosTestEnvironment), nameof(CosmosTestEnvironment.IsNotLinuxEmulator))]
19+
[ConditionalTheory(typeof(CosmosTestEnvironment), nameof(CosmosTestEnvironment.IsNotLinuxEmulator))]
20+
[InlineData(false)]
21+
[InlineData(true)]
2022
public async Task Can_add_update_delete_end_to_end(bool transactionalBatch)
2123
{
2224
var contextFactory = await InitializeNonSharedTest<DbContext>(
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
// Licensed to the .NET Foundation under one or more agreements.
22
// The .NET Foundation licenses this file to you under the MIT license.
33

4-
// Skip the entire assembly if cannot connect to CosmosDb
4+
using Microsoft.EntityFrameworkCore.TestUtilities.Xunit;
55

6-
[assembly: CosmosDbConfiguredCondition]
6+
// Skip the entire assembly if cannot connect to CosmosDb
7+
[assembly: ConditionalAssembly(typeof(CosmosTestEnvironment), nameof(CosmosTestEnvironment.IsAvailable))]
78

89
// Waiting on Task causes deadlocks when run in parallel
910
[assembly: CollectionBehavior(DisableTestParallelization = true)]

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@ protected override ITestStoreFactory NonSharedTestStoreFactory
1111
=> CosmosTestStoreFactory.Instance;
1212

1313
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/288 (Complex-type equality comparisons return no results)
14-
[ConditionalFact(typeof(CosmosTestEnvironment), nameof(CosmosTestEnvironment.IsNotLinuxEmulator))]
1514
public override async Task Complex_type_equals_parameter_with_nested_types_with_property_of_same_name()
1615
{
16+
CosmosTestEnvironment.SkipOnLinuxEmulator();
17+
1718
await base.Complex_type_equals_parameter_with_nested_types_with_property_of_same_name();
1819

1920
AssertSql(

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ FROM root c
2727
}
2828

2929
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/287 (Aggregates over subqueries return null result set)
30-
[ConditionalFact(typeof(CosmosTestEnvironment), nameof(CosmosTestEnvironment.IsNotLinuxEmulator))]
3130
public override async Task Where()
3231
{
32+
CosmosTestEnvironment.SkipOnLinuxEmulator();
33+
3334
await base.Where();
3435

3536
AssertSql(
@@ -208,9 +209,10 @@ public override Task GroupBy()
208209
#endregion GroupBy
209210

210211
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/287 (Aggregates over subqueries return null result set)
211-
[ConditionalFact(typeof(CosmosTestEnvironment), nameof(CosmosTestEnvironment.IsNotLinuxEmulator))]
212212
public override async Task Select_within_Select_within_Select_with_aggregates()
213213
{
214+
CosmosTestEnvironment.SkipOnLinuxEmulator();
215+
214216
await base.Select_within_Select_within_Select_with_aggregates();
215217

216218
AssertSql(

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,10 @@ FROM root c
7373
}
7474

7575
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/287 (Aggregates over subqueries return null result set)
76-
[ConditionalFact(typeof(CosmosTestEnvironment), nameof(CosmosTestEnvironment.IsNotLinuxEmulator))]
7776
public override async Task Select_Sum()
7877
{
78+
CosmosTestEnvironment.SkipOnLinuxEmulator();
79+
7980
await base.Select_Sum();
8081

8182
AssertSql(

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

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,10 @@ FROM root c
8484
}
8585

8686
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/288 (Complex-type equality comparisons return no results)
87-
[ConditionalFact(typeof(CosmosTestEnvironment), nameof(CosmosTestEnvironment.IsNotLinuxEmulator))]
8887
public override async Task Nested_associate_with_inline()
8988
{
89+
CosmosTestEnvironment.SkipOnLinuxEmulator();
90+
9091
await base.Nested_associate_with_inline();
9192

9293
AssertSql(
@@ -98,9 +99,10 @@ FROM root c
9899
}
99100

100101
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/288 (Complex-type equality comparisons return no results)
101-
[ConditionalFact(typeof(CosmosTestEnvironment), nameof(CosmosTestEnvironment.IsNotLinuxEmulator))]
102102
public override async Task Nested_associate_with_parameter()
103103
{
104+
CosmosTestEnvironment.SkipOnLinuxEmulator();
105+
104106
await base.Nested_associate_with_parameter();
105107

106108
AssertSql(
@@ -160,9 +162,10 @@ FROM root c
160162
}
161163

162164
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/288 (Complex-type equality comparisons return no results)
163-
[ConditionalFact(typeof(CosmosTestEnvironment), nameof(CosmosTestEnvironment.IsNotLinuxEmulator))]
164165
public override async Task Nested_collection_with_inline()
165166
{
167+
CosmosTestEnvironment.SkipOnLinuxEmulator();
168+
166169
await base.Nested_collection_with_inline();
167170

168171
AssertSql(
@@ -174,9 +177,10 @@ FROM root c
174177
}
175178

176179
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/288 (Complex-type equality comparisons return no results)
177-
[ConditionalFact(typeof(CosmosTestEnvironment), nameof(CosmosTestEnvironment.IsNotLinuxEmulator))]
178180
public override async Task Nested_collection_with_parameter()
179181
{
182+
CosmosTestEnvironment.SkipOnLinuxEmulator();
183+
180184
await base.Nested_collection_with_parameter();
181185

182186
AssertSql(
@@ -205,9 +209,10 @@ FROM root c
205209
#region Contains
206210

207211
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/288 (Complex-type equality comparisons return no results)
208-
[ConditionalFact(typeof(CosmosTestEnvironment), nameof(CosmosTestEnvironment.IsNotLinuxEmulator))]
209212
public override async Task Contains_with_inline()
210213
{
214+
CosmosTestEnvironment.SkipOnLinuxEmulator();
215+
211216
await base.Contains_with_inline();
212217

213218
AssertSql(
@@ -222,9 +227,10 @@ FROM n IN c["RequiredAssociate"]["NestedCollection"]
222227
}
223228

224229
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/288 (Complex-type equality comparisons return no results)
225-
[ConditionalFact(typeof(CosmosTestEnvironment), nameof(CosmosTestEnvironment.IsNotLinuxEmulator))]
226230
public override async Task Contains_with_parameter()
227231
{
232+
CosmosTestEnvironment.SkipOnLinuxEmulator();
233+
228234
await base.Contains_with_parameter();
229235

230236
AssertSql(
@@ -241,9 +247,10 @@ FROM n IN c["RequiredAssociate"]["NestedCollection"]
241247
}
242248

243249
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/288 (Complex-type equality comparisons return no results)
244-
[ConditionalFact(typeof(CosmosTestEnvironment), nameof(CosmosTestEnvironment.IsNotLinuxEmulator))]
245250
public override async Task Contains_with_operators_composed_on_the_collection()
246251
{
252+
CosmosTestEnvironment.SkipOnLinuxEmulator();
253+
247254
await base.Contains_with_operators_composed_on_the_collection();
248255

249256
AssertSql(
@@ -261,9 +268,10 @@ FROM n IN c["RequiredAssociate"]["NestedCollection"]
261268
}
262269

263270
// https://github.com/Azure/azure-cosmos-db-emulator-docker/issues/288 (Complex-type equality comparisons return no results)
264-
[ConditionalFact(typeof(CosmosTestEnvironment), nameof(CosmosTestEnvironment.IsNotLinuxEmulator))]
265271
public override async Task Contains_with_nested_and_composed_operators()
266272
{
273+
CosmosTestEnvironment.SkipOnLinuxEmulator();
274+
267275
await base.Contains_with_nested_and_composed_operators();
268276

269277
AssertSql(

0 commit comments

Comments
 (0)