From 5ac98b699f69e77cd28658ef4cf5295b6a73862d Mon Sep 17 00:00:00 2001 From: Shay Rojansky Date: Mon, 1 Jun 2026 12:18:42 +0200 Subject: [PATCH] Sync to EF 11.0.0-preview.5.26279.113 EF Core reverted its test infrastructure from xunit v3 back to xunit v2 on the preview.5 line, so this reverts the xunit-v3/MTP migration that was introduced in the previous sync (3ddc83c0), while keeping the genuine EF API/test-baseline fallout for the new build. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/build.yml | 2 +- Directory.Packages.props | 7 ++-- NuGet.config | 3 -- global.json | 3 -- test/Directory.Build.props | 12 ++---- .../BuiltInDataTypesNpgsqlTest.cs | 2 +- .../NorthwindBulkUpdatesNpgsqlTest.cs | 4 ++ .../ComputedColumnTest.cs | 4 +- .../ConnectionInterceptionNpgsqlTest.cs | 8 ++-- .../ConvertToProviderTypesNpgsqlTest.cs | 2 +- .../CustomConvertersNpgsqlTest.cs | 2 +- .../JsonTypesNpgsqlTest.cs | 4 ++ .../LazyLoadProxyNpgsqlTest.cs | 3 +- .../MigrationsInfrastructureNpgsqlTest.cs | 10 ++--- .../Migrations/MigrationsNpgsqlTest.cs | 4 +- .../AdHocMiscellaneousQueryNpgsqlTest.cs | 2 +- .../ComplexJsonCollectionNpgsqlTest.cs | 1 + .../NavigationsCollectionNpgsqlTest.cs | 1 + .../OwnedJsonCollectionNpgsqlTest.cs | 1 + .../OwnedNavigationsCollectionNpgsqlTest.cs | 1 + .../Query/CompatibilityQueryNpgsqlTest.cs | 6 +-- ...lexNavigationsSharedTypeQueryNpgsqlTest.cs | 6 +-- .../Query/EntitySplittingQueryNpgsqlTest.cs | 40 +++++++++---------- .../Query/FromSqlQueryNpgsqlTest.cs | 5 ++- .../TPCInheritanceQueryNpgsqlTest.cs | 5 ++- .../Query/LegacyTimestampQueryTest.cs | 6 +-- .../NorthwindDbFunctionsQueryNpgsqlTest.cs | 2 +- .../Query/NorthwindGroupByQueryNpgsqlTest.cs | 2 +- .../PrimitiveCollectionsQueryNpgsqlTest.cs | 1 + .../Query/SqlQueryNpgsqlTest.cs | 8 ++-- .../ByteArrayTranslationsNpgsqlTest.cs | 1 + .../MathTranslationsNpgsqlTest.cs | 10 ----- .../Query/UdfDbFunctionNpgsqlTests.cs | 2 +- .../NpgsqlDatabaseModelFactoryTest.cs | 2 +- .../SequenceEndToEndTest.cs | 4 +- .../MinimumPostgresVersionAttribute.cs | 9 ++--- .../TestUtilities/RequiresPostgisAttribute.cs | 12 ++---- .../Update/JsonUpdateNpgsqlTest.cs | 2 + .../ValueConvertersEndToEndNpgsqlTest.cs | 2 +- 39 files changed, 96 insertions(+), 105 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2d64d97a47..67c789d4ce 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -112,7 +112,7 @@ jobs: shell: bash - name: Test - run: dotnet test -c ${{ matrix.config }} -- --no-progress + run: dotnet test -c ${{ matrix.config }} --logger "GitHubActions;report-warnings=false" shell: bash env: # Disable SSL to avoid unnecessary handshake pressure in the Windows functional tests. diff --git a/Directory.Packages.props b/Directory.Packages.props index 120d9ef5f3..f75884e23b 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -1,8 +1,8 @@ - 11.0.0-preview.5.26275.101 - 11.0.0-preview.5.26275.101 - 11.0.0-preview.5.26275.101 + 11.0.0-preview.5.26279.113 + 11.0.0-preview.5.26279.113 + 11.0.0-preview.5.26279.113 10.0.3 @@ -28,7 +28,6 @@ - diff --git a/NuGet.config b/NuGet.config index 12be56142c..98c370333c 100644 --- a/NuGet.config +++ b/NuGet.config @@ -21,9 +21,6 @@ - - - diff --git a/global.json b/global.json index 4c949e8da4..973ee8c8d8 100644 --- a/global.json +++ b/global.json @@ -3,8 +3,5 @@ "version": "11.0.100-preview.4.26210.111", "rollForward": "latestMinor", "allowPrerelease": true - }, - "test": { - "runner": "Microsoft.Testing.Platform" } } diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 29fde2d016..b4dbbaa8a6 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -5,21 +5,14 @@ false false - true - $(NoWarn);CS0618;xUnit1003;xUnit1004;xUnit1008;xUnit1013;xUnit1024;xUnit1051;EF1001 - - - - Exe - XUnitV3 - $(TestingPlatformCommandLineArguments) --filter-not-trait category=failing --ignore-exit-code 8 + $(NoWarn);xUnit1003;xUnit1004;xUnit1013;xUnit1024;EF1001 - + @@ -31,6 +24,7 @@ + diff --git a/test/EFCore.PG.FunctionalTests/BuiltInDataTypesNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/BuiltInDataTypesNpgsqlTest.cs index 4a22ecd807..5f9ba85d85 100644 --- a/test/EFCore.PG.FunctionalTests/BuiltInDataTypesNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/BuiltInDataTypesNpgsqlTest.cs @@ -719,7 +719,7 @@ private static void AssertNullMappedNullableDataTypes(MappedNullableDataTypes en Assert.Null(entity.Mood); } - [ActiveIssue("DateTimeOffset with non-zero offset, https://github.com/dotnet/efcore/issues/26068")] + [ConditionalFact(Skip = "DateTimeOffset with non-zero offset, https://github.com/dotnet/efcore/issues/26068")] public override Task Can_insert_and_read_back_object_backed_data_types() => Task.CompletedTask; diff --git a/test/EFCore.PG.FunctionalTests/BulkUpdates/NorthwindBulkUpdatesNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/BulkUpdates/NorthwindBulkUpdatesNpgsqlTest.cs index 4907a97587..ba1fce5126 100644 --- a/test/EFCore.PG.FunctionalTests/BulkUpdates/NorthwindBulkUpdatesNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/BulkUpdates/NorthwindBulkUpdatesNpgsqlTest.cs @@ -1407,6 +1407,7 @@ WHERE c."CustomerID" LIKE 'F%' """); } + [ConditionalTheory] public override async Task Update_with_cross_join_left_join_set_constant(bool async) { await base.Update_with_cross_join_left_join_set_constant(async); @@ -1436,6 +1437,7 @@ WHERE c."CustomerID" LIKE 'F%' """); } + [ConditionalTheory] public override async Task Update_with_cross_join_cross_apply_set_constant(bool async) { await base.Update_with_cross_join_cross_apply_set_constant(async); @@ -1465,6 +1467,7 @@ WHERE c."CustomerID" LIKE 'F%' """); } + [ConditionalTheory] public override async Task Update_with_cross_join_outer_apply_set_constant(bool async) { await base.Update_with_cross_join_outer_apply_set_constant(async); @@ -1574,6 +1577,7 @@ WHERE c."CustomerID" LIKE 'F%' """); } + [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public override async Task Update_with_two_inner_joins(bool async) { diff --git a/test/EFCore.PG.FunctionalTests/ComputedColumnTest.cs b/test/EFCore.PG.FunctionalTests/ComputedColumnTest.cs index 33ca759145..46de11410b 100644 --- a/test/EFCore.PG.FunctionalTests/ComputedColumnTest.cs +++ b/test/EFCore.PG.FunctionalTests/ComputedColumnTest.cs @@ -134,9 +134,9 @@ public void Can_use_computed_columns_with_nullable_enum() protected NpgsqlTestStore TestStore { get; private set; } = null!; - public async ValueTask InitializeAsync() + public async Task InitializeAsync() => TestStore = await NpgsqlTestStore.CreateInitializedAsync("ComputedColumnTest"); - public async ValueTask DisposeAsync() + public async Task DisposeAsync() => await TestStore.DisposeAsync(); } diff --git a/test/EFCore.PG.FunctionalTests/ConnectionInterceptionNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/ConnectionInterceptionNpgsqlTest.cs index d9cc6c28d4..ad7b852f13 100644 --- a/test/EFCore.PG.FunctionalTests/ConnectionInterceptionNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/ConnectionInterceptionNpgsqlTest.cs @@ -7,19 +7,19 @@ namespace Microsoft.EntityFrameworkCore; public abstract class ConnectionInterceptionNpgsqlTestBase(ConnectionInterceptionNpgsqlTestBase.InterceptionNpgsqlFixtureBase fixture) : ConnectionInterceptionTestBase(fixture) { - [ActiveIssue("#2368")] + [ConditionalTheory(Skip = "#2368")] public override Task Intercept_connection_creation_passively(bool async) => base.Intercept_connection_creation_passively(async); - [ActiveIssue("#2368")] + [ConditionalTheory(Skip = "#2368")] public override Task Intercept_connection_creation_with_multiple_interceptors(bool async) => base.Intercept_connection_creation_with_multiple_interceptors(async); - [ActiveIssue("#2368")] + [ConditionalTheory(Skip = "#2368")] public override Task Intercept_connection_to_override_connection_after_creation(bool async) => base.Intercept_connection_to_override_connection_after_creation(async); - [ActiveIssue("#2368")] + [ConditionalTheory(Skip = "#2368")] public override Task Intercept_connection_to_override_creation(bool async) => base.Intercept_connection_to_override_creation(async); diff --git a/test/EFCore.PG.FunctionalTests/ConvertToProviderTypesNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/ConvertToProviderTypesNpgsqlTest.cs index c265f96ce9..ee2ddc0025 100644 --- a/test/EFCore.PG.FunctionalTests/ConvertToProviderTypesNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/ConvertToProviderTypesNpgsqlTest.cs @@ -49,7 +49,7 @@ public ConvertToProviderTypesNpgsqlTest(ConvertToProviderTypesNpgsqlFixture fixt // } // } - [ActiveIssue("DateTimeOffset with non-zero offset, https://github.com/dotnet/efcore/issues/26068")] + [ConditionalFact(Skip = "DateTimeOffset with non-zero offset, https://github.com/dotnet/efcore/issues/26068")] public override Task Can_insert_and_read_back_object_backed_data_types() => Task.CompletedTask; diff --git a/test/EFCore.PG.FunctionalTests/CustomConvertersNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/CustomConvertersNpgsqlTest.cs index 170abf3666..faeb6c72b7 100644 --- a/test/EFCore.PG.FunctionalTests/CustomConvertersNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/CustomConvertersNpgsqlTest.cs @@ -7,7 +7,7 @@ public class CustomConvertersNpgsqlTest(CustomConvertersNpgsqlTest.CustomConvert public override Task Can_insert_and_read_back_with_case_insensitive_string_key() => Task.CompletedTask; - [ActiveIssue("DateTimeOffset with non-zero offset, https://github.com/dotnet/efcore/issues/26068")] + [ConditionalFact(Skip = "DateTimeOffset with non-zero offset, https://github.com/dotnet/efcore/issues/26068")] public override Task Can_insert_and_read_back_object_backed_data_types() => Task.CompletedTask; diff --git a/test/EFCore.PG.FunctionalTests/JsonTypesNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/JsonTypesNpgsqlTest.cs index d47db88de4..7446bed8cd 100644 --- a/test/EFCore.PG.FunctionalTests/JsonTypesNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/JsonTypesNpgsqlTest.cs @@ -210,6 +210,7 @@ protected class NpgsqlDateOnlyCollectionType public List DateOnly { get; set; } = null!; } + [ConditionalFact] public override Task Can_read_write_collection_of_nullable_DateOnly_JSON_values() => Can_read_and_write_JSON_value>( nameof(NullableDateOnlyCollectionType.DateOnly), @@ -461,6 +462,7 @@ public virtual Task Can_read_write_LogSequenceNumber_JSON_values(ulong value, st new NpgsqlLogSequenceNumber(value), json); + [ConditionalFact] public override async Task Can_read_write_point() { var factory = NtsGeometryServices.Instance.CreateGeometryFactory(srid: 4326); @@ -478,6 +480,7 @@ public virtual async Task Can_read_write_point_without_SRID() new Point(2, 4), """{"Prop":"POINT (2 4)"}"""); + [ConditionalFact] public override async Task Can_read_write_point_with_M() { var factory = NtsGeometryServices.Instance.CreateGeometryFactory(srid: 4326); @@ -508,6 +511,7 @@ await Can_read_and_write_JSON_value( """{"Prop":"SRID=4326;POINT Z(1 2 3)"}"""); } + [ConditionalFact] public override async Task Can_read_write_line_string() { var factory = NtsGeometryServices.Instance.CreateGeometryFactory(srid: 4326); diff --git a/test/EFCore.PG.FunctionalTests/LazyLoadProxyNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/LazyLoadProxyNpgsqlTest.cs index 2b7a5be9ad..d8c871ae5b 100644 --- a/test/EFCore.PG.FunctionalTests/LazyLoadProxyNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/LazyLoadProxyNpgsqlTest.cs @@ -15,9 +15,10 @@ public LazyLoadProxyNpgsqlTest(LoadNpgsqlFixture fixture) public override void Can_serialize_proxies_to_JSON() => Assert.Throws(base.Can_serialize_proxies_to_JSON); + [ConditionalFact] // Requires MARS public override void Top_level_projection_track_entities_before_passing_to_client_method() { } - [ActiveIssue("Possibly requires MARS, investigate")] + [ConditionalTheory(Skip = "Possibly requires MARS, investigate")] public override void Lazy_load_one_to_one_reference_with_recursive_property(EntityState state) => base.Lazy_load_one_to_one_reference_with_recursive_property(state); diff --git a/test/EFCore.PG.FunctionalTests/Migrations/MigrationsInfrastructureNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Migrations/MigrationsInfrastructureNpgsqlTest.cs index 6c58e200f9..d7a66ed60a 100644 --- a/test/EFCore.PG.FunctionalTests/Migrations/MigrationsInfrastructureNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Migrations/MigrationsInfrastructureNpgsqlTest.cs @@ -29,23 +29,23 @@ public override Task Can_apply_two_migrations_in_transaction_async() public override Task Can_generate_no_migration_script() => base.Can_generate_no_migration_script(); - [ActiveIssue("https://github.com/dotnet/efcore/issues/33056")] + [ConditionalFact(Skip = "https://github.com/dotnet/efcore/issues/33056")] public override void Can_apply_all_migrations() => base.Can_apply_all_migrations(); - [ActiveIssue("https://github.com/dotnet/efcore/issues/33056")] + [ConditionalFact(Skip = "https://github.com/dotnet/efcore/issues/33056")] public override void Can_apply_range_of_migrations() => base.Can_apply_range_of_migrations(); - [ActiveIssue("https://github.com/dotnet/efcore/issues/33056")] + [ConditionalFact(Skip = "https://github.com/dotnet/efcore/issues/33056")] public override void Can_revert_all_migrations() => base.Can_revert_all_migrations(); - [ActiveIssue("https://github.com/dotnet/efcore/issues/33056")] + [ConditionalFact(Skip = "https://github.com/dotnet/efcore/issues/33056")] public override void Can_revert_one_migrations() => base.Can_revert_one_migrations(); - [ActiveIssue("https://github.com/dotnet/efcore/issues/33056")] + [ConditionalFact(Skip = "https://github.com/dotnet/efcore/issues/33056")] public override Task Can_apply_all_migrations_async() => base.Can_apply_all_migrations_async(); diff --git a/test/EFCore.PG.FunctionalTests/Migrations/MigrationsNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Migrations/MigrationsNpgsqlTest.cs index aad9d000a8..0d69461cfa 100644 --- a/test/EFCore.PG.FunctionalTests/Migrations/MigrationsNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Migrations/MigrationsNpgsqlTest.cs @@ -3246,7 +3246,7 @@ public override async Task Add_required_primitive_collection_with_custom_default AssertSql("""ALTER TABLE "Customers" ADD "Numbers" integer[] NOT NULL DEFAULT (ARRAY[1,2,3]);"""); } - [ActiveIssue("issue #33038")] + [ConditionalFact(Skip = "issue #33038")] public override async Task Add_required_primitive_collection_with_custom_converter_to_existing_table() { await base.Add_required_primitive_collection_with_custom_converter_to_existing_table(); @@ -3337,7 +3337,7 @@ public override async Task Add_required_primitve_collection_with_custom_default_ AssertSql("""ALTER TABLE "Customers" ADD "Numbers" integer[] NOT NULL DEFAULT ARRAY[1,2,3]::integer[];"""); } - [ActiveIssue("issue #33038")] + [ConditionalFact(Skip = "issue #33038")] public override async Task Add_required_primitve_collection_with_custom_converter_to_existing_table() { await base.Add_required_primitve_collection_with_custom_converter_to_existing_table(); diff --git a/test/EFCore.PG.FunctionalTests/Query/AdHocMiscellaneousQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/AdHocMiscellaneousQueryNpgsqlTest.cs index e94488ab5c..9067340a93 100644 --- a/test/EFCore.PG.FunctionalTests/Query/AdHocMiscellaneousQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/AdHocMiscellaneousQueryNpgsqlTest.cs @@ -33,7 +33,7 @@ public override Task SelectMany_where_Select(bool async) public override Task Subquery_first_member_compared_to_null(bool async) => Task.CompletedTask; - [ActiveIssue("https://github.com/dotnet/efcore/pull/27995/files#r874038747")] + [ConditionalTheory(Skip = "https://github.com/dotnet/efcore/pull/27995/files#r874038747")] public override Task StoreType_for_UDF_used(bool async) => base.StoreType_for_UDF_used(async); } diff --git a/test/EFCore.PG.FunctionalTests/Query/Associations/ComplexJson/ComplexJsonCollectionNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/Associations/ComplexJson/ComplexJsonCollectionNpgsqlTest.cs index 5b3acf76f2..8bb50f0817 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Associations/ComplexJson/ComplexJsonCollectionNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Associations/ComplexJson/ComplexJsonCollectionNpgsqlTest.cs @@ -177,6 +177,7 @@ public override async Task Index_out_of_bounds() #region GroupBy + [ConditionalFact] public override async Task GroupBy() { await base.GroupBy(); diff --git a/test/EFCore.PG.FunctionalTests/Query/Associations/Navigations/NavigationsCollectionNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/Associations/Navigations/NavigationsCollectionNpgsqlTest.cs index 0469b4e45c..75f696e390 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Associations/Navigations/NavigationsCollectionNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Associations/Navigations/NavigationsCollectionNpgsqlTest.cs @@ -210,6 +210,7 @@ public override async Task Index_out_of_bounds() #region GroupBy + [ConditionalFact] public override async Task GroupBy() { await base.GroupBy(); diff --git a/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedJson/OwnedJsonCollectionNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedJson/OwnedJsonCollectionNpgsqlTest.cs index 649da461f7..855fdbb008 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedJson/OwnedJsonCollectionNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedJson/OwnedJsonCollectionNpgsqlTest.cs @@ -191,6 +191,7 @@ public override async Task Index_out_of_bounds() #region GroupBy + [ConditionalFact] public override async Task GroupBy() { await base.GroupBy(); diff --git a/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedNavigations/OwnedNavigationsCollectionNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedNavigations/OwnedNavigationsCollectionNpgsqlTest.cs index 1c0859e643..0d768c9456 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedNavigations/OwnedNavigationsCollectionNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Associations/OwnedNavigations/OwnedNavigationsCollectionNpgsqlTest.cs @@ -213,6 +213,7 @@ public override async Task Index_out_of_bounds() #region GroupBy + [ConditionalFact] public override async Task GroupBy() { await base.GroupBy(); diff --git a/test/EFCore.PG.FunctionalTests/Query/CompatibilityQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/CompatibilityQueryNpgsqlTest.cs index 7792d0c122..2de51d50c1 100644 --- a/test/EFCore.PG.FunctionalTests/Query/CompatibilityQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/CompatibilityQueryNpgsqlTest.cs @@ -1,4 +1,4 @@ -namespace Microsoft.EntityFrameworkCore.Query; +namespace Microsoft.EntityFrameworkCore.Query; public class CompatibilityQueryNpgsqlTest : IClassFixture { @@ -74,7 +74,7 @@ public virtual CompatibilityContext CreateRedshiftContext() return new CompatibilityContext(builder.Options); } - public virtual async ValueTask InitializeAsync() + public virtual async Task InitializeAsync() { _testStore = NpgsqlTestStoreFactory.Instance.GetOrCreate(StoreName); await _testStore.InitializeAsync(null, CreateContext, c => CompatibilityContext.SeedAsync((CompatibilityContext)c)); @@ -85,7 +85,7 @@ public virtual void Dispose() { } - public virtual async ValueTask DisposeAsync() + public virtual async Task DisposeAsync() => await _testStore.DisposeAsync(); } diff --git a/test/EFCore.PG.FunctionalTests/Query/ComplexNavigationsSharedTypeQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/ComplexNavigationsSharedTypeQueryNpgsqlTest.cs index d657a436d3..fc8c7346a2 100644 --- a/test/EFCore.PG.FunctionalTests/Query/ComplexNavigationsSharedTypeQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/ComplexNavigationsSharedTypeQueryNpgsqlTest.cs @@ -15,7 +15,7 @@ public ComplexNavigationsSharedTypeQueryNpgsqlTest( Fixture.TestSqlLoggerFactory.SetTestOutputHelper(testOutputHelper); } - [ActiveIssue("https://github.com/dotnet/efcore/issues/26353")] + [ConditionalTheory(Skip = "https://github.com/dotnet/efcore/issues/26353")] public override Task Subquery_with_Distinct_Skip_FirstOrDefault_without_OrderBy(bool async) => base.Subquery_with_Distinct_Skip_FirstOrDefault_without_OrderBy(async); @@ -30,11 +30,11 @@ public override Task GroupJoin_client_method_in_OrderBy(bool async) "Microsoft.EntityFrameworkCore.Query.ComplexNavigationsQueryTestBase", "ClientMethodNullableInt")); - [ActiveIssue("https://github.com/dotnet/efcore/issues/26104")] + [ConditionalTheory(Skip = "https://github.com/dotnet/efcore/issues/26104")] public override Task GroupBy_aggregate_where_required_relationship(bool async) => base.GroupBy_aggregate_where_required_relationship(async); - [ActiveIssue("https://github.com/dotnet/efcore/issues/26104")] + [ConditionalTheory(Skip = "https://github.com/dotnet/efcore/issues/26104")] public override Task GroupBy_aggregate_where_required_relationship_2(bool async) => base.GroupBy_aggregate_where_required_relationship_2(async); } diff --git a/test/EFCore.PG.FunctionalTests/Query/EntitySplittingQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/EntitySplittingQueryNpgsqlTest.cs index 5f0715a2d7..f9ff56eb76 100644 --- a/test/EFCore.PG.FunctionalTests/Query/EntitySplittingQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/EntitySplittingQueryNpgsqlTest.cs @@ -224,7 +224,7 @@ END AS "OwnedStringValue4" """); } - [ActiveIssue("Issue29075")] + [ConditionalTheory(Skip = "Issue29075")] public override async Task Normal_entity_owning_a_split_reference_with_main_fragment_not_sharing(bool async) { await base.Normal_entity_owning_a_split_reference_with_main_fragment_not_sharing(async); @@ -232,7 +232,7 @@ public override async Task Normal_entity_owning_a_split_reference_with_main_frag AssertSql(); } - [ActiveIssue("Issue29075")] + [ConditionalTheory(Skip = "Issue29075")] public override async Task Normal_entity_owning_a_split_reference_with_main_fragment_not_sharing_custom_projection(bool async) { await base.Normal_entity_owning_a_split_reference_with_main_fragment_not_sharing_custom_projection(async); @@ -240,7 +240,7 @@ public override async Task Normal_entity_owning_a_split_reference_with_main_frag AssertSql(); } - [ActiveIssue("Issue29075")] + [ConditionalTheory(Skip = "Issue29075")] public override async Task Normal_entity_owning_a_split_collection(bool async) { await base.Normal_entity_owning_a_split_collection(async); @@ -291,7 +291,7 @@ public override async Task Split_entity_owning_a_collection(bool async) """); } - [ActiveIssue("Issue29075")] + [ConditionalTheory(Skip = "Issue29075")] public override async Task Split_entity_owning_a_split_reference_without_table_sharing(bool async) { await base.Split_entity_owning_a_split_reference_without_table_sharing(async); @@ -299,7 +299,7 @@ public override async Task Split_entity_owning_a_split_reference_without_table_s AssertSql(); } - [ActiveIssue("Issue29075")] + [ConditionalTheory(Skip = "Issue29075")] public override async Task Split_entity_owning_a_split_collection(bool async) { await base.Split_entity_owning_a_split_collection(async); @@ -334,7 +334,7 @@ public override async Task Split_entity_owning_a_split_reference_with_table_shar """); } - [ActiveIssue("Issue29075")] + [ConditionalTheory(Skip = "Issue29075")] public override async Task Split_entity_owning_a_split_reference_with_table_sharing_6(bool async) { await base.Split_entity_owning_a_split_reference_with_table_sharing_6(async); @@ -562,7 +562,7 @@ public override async Task Tpc_entity_owning_a_split_reference_on_leaf_with_tabl """); } - [ActiveIssue("Issue29075")] + [ConditionalTheory(Skip = "Issue29075")] public override async Task Tph_entity_owning_a_split_reference_on_base_without_table_sharing(bool async) { await base.Tph_entity_owning_a_split_reference_on_base_without_table_sharing(async); @@ -570,7 +570,7 @@ public override async Task Tph_entity_owning_a_split_reference_on_base_without_t AssertSql(); } - [ActiveIssue("Issue29075")] + [ConditionalTheory(Skip = "Issue29075")] public override async Task Tpt_entity_owning_a_split_reference_on_base_without_table_sharing(bool async) { await base.Tpt_entity_owning_a_split_reference_on_base_without_table_sharing(async); @@ -604,7 +604,7 @@ UNION ALL """); } - [ActiveIssue("Issue29075")] + [ConditionalTheory(Skip = "Issue29075")] public override async Task Tph_entity_owning_a_split_reference_on_middle_without_table_sharing(bool async) { await base.Tph_entity_owning_a_split_reference_on_middle_without_table_sharing(async); @@ -612,7 +612,7 @@ public override async Task Tph_entity_owning_a_split_reference_on_middle_without AssertSql(); } - [ActiveIssue("Issue29075")] + [ConditionalTheory(Skip = "Issue29075")] public override async Task Tpt_entity_owning_a_split_reference_on_middle_without_table_sharing(bool async) { await base.Tpt_entity_owning_a_split_reference_on_middle_without_table_sharing(async); @@ -646,7 +646,7 @@ UNION ALL """); } - [ActiveIssue("Issue29075")] + [ConditionalTheory(Skip = "Issue29075")] public override async Task Tph_entity_owning_a_split_reference_on_leaf_without_table_sharing(bool async) { await base.Tph_entity_owning_a_split_reference_on_leaf_without_table_sharing(async); @@ -654,7 +654,7 @@ public override async Task Tph_entity_owning_a_split_reference_on_leaf_without_t AssertSql(); } - [ActiveIssue("Issue29075")] + [ConditionalTheory(Skip = "Issue29075")] public override async Task Tpt_entity_owning_a_split_reference_on_leaf_without_table_sharing(bool async) { await base.Tpt_entity_owning_a_split_reference_on_leaf_without_table_sharing(async); @@ -662,7 +662,7 @@ public override async Task Tpt_entity_owning_a_split_reference_on_leaf_without_t AssertSql(); } - [ActiveIssue("Issue29075")] + [ConditionalTheory(Skip = "Issue29075")] public override async Task Tpc_entity_owning_a_split_reference_on_leaf_without_table_sharing(bool async) { await base.Tpc_entity_owning_a_split_reference_on_leaf_without_table_sharing(async); @@ -670,7 +670,7 @@ public override async Task Tpc_entity_owning_a_split_reference_on_leaf_without_t AssertSql(); } - [ActiveIssue("Issue29075")] + [ConditionalTheory(Skip = "Issue29075")] public override async Task Tph_entity_owning_a_split_collection_on_base(bool async) { await base.Tph_entity_owning_a_split_collection_on_base(async); @@ -678,7 +678,7 @@ public override async Task Tph_entity_owning_a_split_collection_on_base(bool asy AssertSql(); } - [ActiveIssue("Issue29075")] + [ConditionalTheory(Skip = "Issue29075")] public override async Task Tpt_entity_owning_a_split_collection_on_base(bool async) { await base.Tpt_entity_owning_a_split_collection_on_base(async); @@ -716,7 +716,7 @@ LEFT JOIN ( """); } - [ActiveIssue("Issue29075")] + [ConditionalTheory(Skip = "Issue29075")] public override async Task Tph_entity_owning_a_split_collection_on_middle(bool async) { await base.Tph_entity_owning_a_split_collection_on_middle(async); @@ -724,7 +724,7 @@ public override async Task Tph_entity_owning_a_split_collection_on_middle(bool a AssertSql(); } - [ActiveIssue("Issue29075")] + [ConditionalTheory(Skip = "Issue29075")] public override async Task Tpt_entity_owning_a_split_collection_on_middle(bool async) { await base.Tpt_entity_owning_a_split_collection_on_middle(async); @@ -762,7 +762,7 @@ LEFT JOIN ( """); } - [ActiveIssue("Issue29075")] + [ConditionalTheory(Skip = "Issue29075")] public override async Task Tph_entity_owning_a_split_collection_on_leaf(bool async) { await base.Tph_entity_owning_a_split_collection_on_leaf(async); @@ -770,7 +770,7 @@ public override async Task Tph_entity_owning_a_split_collection_on_leaf(bool asy AssertSql(); } - [ActiveIssue("Issue29075")] + [ConditionalTheory(Skip = "Issue29075")] public override async Task Tpt_entity_owning_a_split_collection_on_leaf(bool async) { await base.Tpt_entity_owning_a_split_collection_on_leaf(async); @@ -778,7 +778,7 @@ public override async Task Tpt_entity_owning_a_split_collection_on_leaf(bool asy AssertSql(); } - [ActiveIssue("Issue29075")] + [ConditionalTheory(Skip = "Issue29075")] public override async Task Tpc_entity_owning_a_split_collection_on_leaf(bool async) { await base.Tpc_entity_owning_a_split_collection_on_leaf(async); diff --git a/test/EFCore.PG.FunctionalTests/Query/FromSqlQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/FromSqlQueryNpgsqlTest.cs index ffea659b78..3e252ec922 100644 --- a/test/EFCore.PG.FunctionalTests/Query/FromSqlQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/FromSqlQueryNpgsqlTest.cs @@ -7,11 +7,11 @@ namespace Microsoft.EntityFrameworkCore.Query; public class FromSqlQueryNpgsqlTest(NorthwindQueryNpgsqlFixture fixture) : FromSqlQueryTestBase>(fixture) { - [ActiveIssue("https://github.com/aspnet/EntityFramework/issues/{6563,20364}")] + [ConditionalTheory(Skip = "https://github.com/aspnet/EntityFramework/issues/{6563,20364}")] public override Task Bad_data_error_handling_invalid_cast(bool async) => base.Bad_data_error_handling_invalid_cast(async); - [ActiveIssue("https://github.com/aspnet/EntityFramework/issues/{6563,20364}")] + [ConditionalTheory(Skip = "https://github.com/aspnet/EntityFramework/issues/{6563,20364}")] public override Task Bad_data_error_handling_invalid_cast_projection(bool async) => base.Bad_data_error_handling_invalid_cast_projection(async); @@ -66,6 +66,7 @@ from o in context.Set().FromSql( Assert.Single(actual); } + [ConditionalTheory] [MemberData(nameof(IsAsyncData))] public override async Task FromSql_queryable_multiple_composed_with_parameters_and_closure_parameters_interpolated(bool async) { diff --git a/test/EFCore.PG.FunctionalTests/Query/Inheritance/TPCInheritanceQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/Inheritance/TPCInheritanceQueryNpgsqlTest.cs index e124392713..427cd8c2a1 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Inheritance/TPCInheritanceQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Inheritance/TPCInheritanceQueryNpgsqlTest.cs @@ -78,8 +78,11 @@ ORDER BY e1."Id" NULLS FIRST """); } + // Seed data for the fixture manually inserts entities with IDs 1, 2; then this test attempts to insert another one with an auto-generated ID, + // but the PG sequence wasn't updated so produces 1, resulting in a conflict. The test should be consistent in either using either + // auto-generated IDs or not across the board. public override Task Can_insert_update_delete() - => base.Can_insert_update_delete(); + => Assert.ThrowsAsync(base.Can_insert_update_delete); public override async Task Can_query_all_animals(bool async) { diff --git a/test/EFCore.PG.FunctionalTests/Query/LegacyTimestampQueryTest.cs b/test/EFCore.PG.FunctionalTests/Query/LegacyTimestampQueryTest.cs index 899fc618d7..ad50487189 100644 --- a/test/EFCore.PG.FunctionalTests/Query/LegacyTimestampQueryTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/LegacyTimestampQueryTest.cs @@ -1,4 +1,4 @@ -using System.ComponentModel.DataAnnotations.Schema; +using System.ComponentModel.DataAnnotations.Schema; using Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal; #if DEBUG @@ -110,10 +110,10 @@ public LegacyTimestampQueryFixture() NpgsqlTypeMappingSource.LegacyTimestampBehavior = true; } - public override ValueTask DisposeAsync() + public override Task DisposeAsync() { NpgsqlTypeMappingSource.LegacyTimestampBehavior = false; - return ValueTask.CompletedTask; + return Task.CompletedTask; } protected override async Task SeedAsync(TimestampQueryContext context) diff --git a/test/EFCore.PG.FunctionalTests/Query/NorthwindDbFunctionsQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/NorthwindDbFunctionsQueryNpgsqlTest.cs index 71be547c88..64df0f9ec1 100644 --- a/test/EFCore.PG.FunctionalTests/Query/NorthwindDbFunctionsQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/NorthwindDbFunctionsQueryNpgsqlTest.cs @@ -127,7 +127,7 @@ WHERE c."ContactName" NOT ILIKE '%M%' OR c."ContactName" IS NULL #region Collation [MinimumPostgresVersion(12, 0)] - [SkipOnPlatform(TestPlatforms.Windows, "ICU non-deterministic doesn't seem to work on Windows?")] + [PlatformSkipCondition(TestUtilities.Xunit.TestPlatform.Windows, SkipReason = "ICU non-deterministic doesn't seem to work on Windows?")] public override async Task Collate_case_insensitive(bool async) { await base.Collate_case_insensitive(async); diff --git a/test/EFCore.PG.FunctionalTests/Query/NorthwindGroupByQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/NorthwindGroupByQueryNpgsqlTest.cs index e38d340feb..9d83ef072f 100644 --- a/test/EFCore.PG.FunctionalTests/Query/NorthwindGroupByQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/NorthwindGroupByQueryNpgsqlTest.cs @@ -2031,7 +2031,7 @@ ORDER BY o0."CustomerID" NULLS FIRST """); } - [ActiveIssue("https://github.com/dotnet/efcore/pull/28410")] + [ConditionalTheory(Skip = "https://github.com/dotnet/efcore/pull/28410")] public override async Task Select_nested_collection_with_groupby(bool async) { await base.Select_nested_collection_with_groupby(async); diff --git a/test/EFCore.PG.FunctionalTests/Query/PrimitiveCollectionsQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/PrimitiveCollectionsQueryNpgsqlTest.cs index d95d6948b9..4613bd4fa9 100644 --- a/test/EFCore.PG.FunctionalTests/Query/PrimitiveCollectionsQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/PrimitiveCollectionsQueryNpgsqlTest.cs @@ -2657,6 +2657,7 @@ WHERE NOT (p."Int" = ANY (@ints) AND p."Int" = ANY (@ints) IS NOT NULL) """); } + [ConditionalFact] public override async Task Multidimensional_array_is_not_supported() { // Multidimensional arrays are supported in PostgreSQL (via the regular array type); the EFCore.PG maps .NET diff --git a/test/EFCore.PG.FunctionalTests/Query/SqlQueryNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/SqlQueryNpgsqlTest.cs index 3049646d06..790c9afa0d 100644 --- a/test/EFCore.PG.FunctionalTests/Query/SqlQueryNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/SqlQueryNpgsqlTest.cs @@ -360,7 +360,7 @@ SELECT m."ProductName" """); } - [ActiveIssue("https://github.com/dotnet/efcore/pull/30384")] + [ConditionalTheory(Skip = "https://github.com/dotnet/efcore/pull/30384")] public override async Task SqlQueryRaw_annotations_do_not_affect_successive_calls(bool async) { await base.SqlQueryRaw_annotations_do_not_affect_successive_calls(async); @@ -460,7 +460,7 @@ public override async Task SqlQuery_with_inlined_db_parameter_without_name_prefi """); } - [ActiveIssue("https://github.com/dotnet/efcore/pull/30384")] + [ConditionalTheory(Skip = "https://github.com/dotnet/efcore/pull/30384")] public override async Task SqlQuery_parameterization_issue_12213(bool async) { await base.SqlQuery_parameterization_issue_12213(async); @@ -672,11 +672,11 @@ WHERE m."ContactName" LIKE '%z%' } #pragma warning disable xUnit1026 - [ActiveIssue("https://github.com/dotnet/efcore/pull/30384")] + [ConditionalTheory(Skip = "https://github.com/dotnet/efcore/pull/30384")] public override Task Bad_data_error_handling_invalid_cast(bool async) => Task.CompletedTask; - [ActiveIssue("https://github.com/dotnet/efcore/pull/30384")] + [ConditionalTheory(Skip = "https://github.com/dotnet/efcore/pull/30384")] public override Task Bad_data_error_handling_invalid_cast_projection(bool async) => Task.CompletedTask; #pragma warning restore xUnit1026 diff --git a/test/EFCore.PG.FunctionalTests/Query/Translations/ByteArrayTranslationsNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/Translations/ByteArrayTranslationsNpgsqlTest.cs index 1dbd9c51c7..8ec0c43dd7 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Translations/ByteArrayTranslationsNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Translations/ByteArrayTranslationsNpgsqlTest.cs @@ -100,6 +100,7 @@ public override async Task SequenceEqual() """); } + [ConditionalFact] public override async Task Any() { await AssertQuery(ss => ss.Set().Where(e => e.ByteArray.Any())); diff --git a/test/EFCore.PG.FunctionalTests/Query/Translations/MathTranslationsNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Query/Translations/MathTranslationsNpgsqlTest.cs index a410dc72a4..36a6960e04 100644 --- a/test/EFCore.PG.FunctionalTests/Query/Translations/MathTranslationsNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Query/Translations/MathTranslationsNpgsqlTest.cs @@ -427,11 +427,6 @@ public override async Task Sign() SELECT b."Id", b."Bool", b."Byte", b."ByteArray", b."DateOnly", b."DateTime", b."DateTimeOffset", b."Decimal", b."Double", b."Enum", b."FlagsEnum", b."Float", b."Guid", b."Int", b."Long", b."Short", b."String", b."TimeOnly", b."TimeSpan" FROM "BasicTypesEntities" AS b WHERE sign(b."Double")::int > 0 -""", - // - """ -SELECT sign(b."Double")::int -FROM "BasicTypesEntities" AS b """); } @@ -444,11 +439,6 @@ public override async Task Sign_float() SELECT b."Id", b."Bool", b."Byte", b."ByteArray", b."DateOnly", b."DateTime", b."DateTimeOffset", b."Decimal", b."Double", b."Enum", b."FlagsEnum", b."Float", b."Guid", b."Int", b."Long", b."Short", b."String", b."TimeOnly", b."TimeSpan" FROM "BasicTypesEntities" AS b WHERE sign(b."Float")::int > 0 -""", - // - """ -SELECT sign(b."Float")::int -FROM "BasicTypesEntities" AS b """); } diff --git a/test/EFCore.PG.FunctionalTests/Query/UdfDbFunctionNpgsqlTests.cs b/test/EFCore.PG.FunctionalTests/Query/UdfDbFunctionNpgsqlTests.cs index ec6051c86b..5626e5c8d2 100644 --- a/test/EFCore.PG.FunctionalTests/Query/UdfDbFunctionNpgsqlTests.cs +++ b/test/EFCore.PG.FunctionalTests/Query/UdfDbFunctionNpgsqlTests.cs @@ -584,7 +584,7 @@ LIMIT 2 #endregion #if RELEASE - [ActiveIssue("https://github.com/dotnet/efcore/pull/30388")] + [ConditionalFact(Skip = "https://github.com/dotnet/efcore/pull/30388")] public override void Scalar_Function_with_nullable_value_return_type_throws() {} #endif diff --git a/test/EFCore.PG.FunctionalTests/Scaffolding/NpgsqlDatabaseModelFactoryTest.cs b/test/EFCore.PG.FunctionalTests/Scaffolding/NpgsqlDatabaseModelFactoryTest.cs index faa5c1d666..7cdfe3d885 100644 --- a/test/EFCore.PG.FunctionalTests/Scaffolding/NpgsqlDatabaseModelFactoryTest.cs +++ b/test/EFCore.PG.FunctionalTests/Scaffolding/NpgsqlDatabaseModelFactoryTest.cs @@ -2214,7 +2214,7 @@ protected override ITestStoreFactory TestStoreFactory public new NpgsqlTestStore TestStore => (NpgsqlTestStore)base.TestStore; - public override async ValueTask InitializeAsync() + public override async Task InitializeAsync() { await base.InitializeAsync(); await TestStore.ExecuteNonQueryAsync("CREATE SCHEMA IF NOT EXISTS db2"); diff --git a/test/EFCore.PG.FunctionalTests/SequenceEndToEndTest.cs b/test/EFCore.PG.FunctionalTests/SequenceEndToEndTest.cs index 918f1a655d..7fea096121 100644 --- a/test/EFCore.PG.FunctionalTests/SequenceEndToEndTest.cs +++ b/test/EFCore.PG.FunctionalTests/SequenceEndToEndTest.cs @@ -391,9 +391,9 @@ private class Unicon protected NpgsqlTestStore TestStore { get; private set; } = null!; - public async ValueTask InitializeAsync() + public async Task InitializeAsync() => TestStore = await NpgsqlTestStore.CreateInitializedAsync("SequenceEndToEndTest"); - public async ValueTask DisposeAsync() + public async Task DisposeAsync() => await TestStore.DisposeAsync(); } diff --git a/test/EFCore.PG.FunctionalTests/TestUtilities/MinimumPostgresVersionAttribute.cs b/test/EFCore.PG.FunctionalTests/TestUtilities/MinimumPostgresVersionAttribute.cs index ab2c93e49a..134331d743 100644 --- a/test/EFCore.PG.FunctionalTests/TestUtilities/MinimumPostgresVersionAttribute.cs +++ b/test/EFCore.PG.FunctionalTests/TestUtilities/MinimumPostgresVersionAttribute.cs @@ -1,16 +1,13 @@ namespace Microsoft.EntityFrameworkCore.TestUtilities; [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class)] -public sealed class MinimumPostgresVersionAttribute(int major, int minor) : Attribute, global::Xunit.v3.ITraitAttribute +public sealed class MinimumPostgresVersionAttribute(int major, int minor) : Attribute, ITestCondition { private readonly Version _version = new(major, minor); - private bool IsMet - => TestEnvironment.PostgresVersion >= _version; + public ValueTask IsMetAsync() + => new(TestEnvironment.PostgresVersion >= _version); public string SkipReason => $"Requires PostgreSQL version {_version} or later."; - - public IReadOnlyCollection> GetTraits() - => IsMet ? [] : [new("category", "failing")]; } diff --git a/test/EFCore.PG.FunctionalTests/TestUtilities/RequiresPostgisAttribute.cs b/test/EFCore.PG.FunctionalTests/TestUtilities/RequiresPostgisAttribute.cs index 73884a712b..5035dc4657 100644 --- a/test/EFCore.PG.FunctionalTests/TestUtilities/RequiresPostgisAttribute.cs +++ b/test/EFCore.PG.FunctionalTests/TestUtilities/RequiresPostgisAttribute.cs @@ -1,17 +1,13 @@ -using System.Globalization; +using System.Globalization; namespace Microsoft.EntityFrameworkCore.TestUtilities; [AttributeUsage(AttributeTargets.Method | AttributeTargets.Class)] -public sealed class RequiresPostgisAttribute : Attribute, global::Xunit.v3.ITraitAttribute +public sealed class RequiresPostgisAttribute : Attribute, ITestCondition { - private static bool IsMet - => TestEnvironment.IsPostgisAvailable - || Environment.GetEnvironmentVariable("NPGSQL_TEST_POSTGIS")?.ToLower(CultureInfo.InvariantCulture) is "1" or "true"; + public ValueTask IsMetAsync() + => new(TestEnvironment.IsPostgisAvailable || Environment.GetEnvironmentVariable("NPGSQL_TEST_POSTGIS")?.ToLower(CultureInfo.InvariantCulture) is "1" or "true"); public string SkipReason => "PostGIS isn't installed, skipping"; - - public IReadOnlyCollection> GetTraits() - => IsMet ? [] : [new("category", "failing")]; } diff --git a/test/EFCore.PG.FunctionalTests/Update/JsonUpdateNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/Update/JsonUpdateNpgsqlTest.cs index 053aef053d..eeb8abaa76 100644 --- a/test/EFCore.PG.FunctionalTests/Update/JsonUpdateNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/Update/JsonUpdateNpgsqlTest.cs @@ -1255,6 +1255,7 @@ LIMIT 2 """); } + [ConditionalFact] public override async Task Edit_single_property_with_converter_string_True_False_to_bool() { await base.Edit_single_property_with_converter_string_True_False_to_bool(); @@ -1276,6 +1277,7 @@ LIMIT 2 """); } + [ConditionalFact] public override async Task Edit_single_property_with_converter_string_Y_N_to_bool() { await base.Edit_single_property_with_converter_string_Y_N_to_bool(); diff --git a/test/EFCore.PG.FunctionalTests/ValueConvertersEndToEndNpgsqlTest.cs b/test/EFCore.PG.FunctionalTests/ValueConvertersEndToEndNpgsqlTest.cs index 82128cbdd5..7fa28f4e15 100644 --- a/test/EFCore.PG.FunctionalTests/ValueConvertersEndToEndNpgsqlTest.cs +++ b/test/EFCore.PG.FunctionalTests/ValueConvertersEndToEndNpgsqlTest.cs @@ -3,7 +3,7 @@ namespace Microsoft.EntityFrameworkCore; public class ValueConvertersEndToEndNpgsqlTest(ValueConvertersEndToEndNpgsqlTest.ValueConvertersEndToEndNpgsqlFixture fixture) : ValueConvertersEndToEndTestBase(fixture) { - [ActiveIssue("DateTime and DateTimeOffset, https://github.com/dotnet/efcore/issues/26068")] + [ConditionalTheory(Skip = "DateTime and DateTimeOffset, https://github.com/dotnet/efcore/issues/26068")] public override Task Can_insert_and_read_back_with_conversions(int[] valueOrder) => base.Can_insert_and_read_back_with_conversions(valueOrder);