Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:
shell: bash

- name: Test
run: dotnet test -c ${{ matrix.config }} --logger "GitHubActions;report-warnings=false"
run: dotnet test -c ${{ matrix.config }} -- --no-progress
shell: bash
env:
# Disable SSL to avoid unnecessary handshake pressure in the Windows functional tests.
Expand Down
7 changes: 4 additions & 3 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project>
<PropertyGroup>
<EFCoreVersion>11.0.0-preview.5.26267.102</EFCoreVersion>
<MicrosoftExtensionsVersion>11.0.0-preview.5.26267.102</MicrosoftExtensionsVersion>
<MicrosoftExtensionsConfigurationVersion>11.0.0-preview.5.26267.102</MicrosoftExtensionsConfigurationVersion>
<EFCoreVersion>11.0.0-preview.5.26275.101</EFCoreVersion>
<MicrosoftExtensionsVersion>11.0.0-preview.5.26275.101</MicrosoftExtensionsVersion>
<MicrosoftExtensionsConfigurationVersion>11.0.0-preview.5.26275.101</MicrosoftExtensionsConfigurationVersion>
<NpgsqlVersion>10.0.0</NpgsqlVersion>
</PropertyGroup>

Expand All @@ -28,6 +28,7 @@

<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageVersion Include="xunit.v3" Version="4.0.0-pre.108" />
<PackageVersion Include="xunit" Version="2.9.3" />
<PackageVersion Include="xunit.assert" Version="2.9.3" />
<PackageVersion Include="xunit.core" Version="2.9.3" />
Expand Down
3 changes: 3 additions & 0 deletions NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
<packageSource key="dotnet11">
<package pattern="*" />
</packageSource>
<packageSource key="dotnet-eng">
<package pattern="Microsoft.DotNet.*" />
</packageSource>
</packageSourceMapping>

</configuration>
3 changes: 3 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,8 @@
"version": "11.0.100-preview.4.26210.111",
"rollForward": "latestMinor",
"allowPrerelease": true
},
"test": {
"runner": "Microsoft.Testing.Platform"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class NpgsqlMathTranslator(
IModel model) : IMethodCallTranslator
{
private readonly RelationalTypeMapping _intTypeMapping = typeMappingSource.FindMapping(typeof(int), model)!;
private readonly RelationalTypeMapping _doubleTypeMapping = typeMappingSource.FindMapping(typeof(double), model)!;
private readonly RelationalTypeMapping _decimalTypeMapping = typeMappingSource.FindMapping(typeof(decimal), model)!;

/// <inheritdoc />
Expand Down Expand Up @@ -226,7 +227,8 @@ SqlExpression TranslateSign(SqlExpression argument)
[argument],
nullable: true,
argumentsPropagateNullability: TrueArrays[1],
method.ReturnType),
argument.Type == typeof(decimal) ? typeof(decimal) : typeof(double),
argument.Type == typeof(decimal) ? argument.TypeMapping : _doubleTypeMapping),
typeof(int),
_intTypeMapping);
}
Expand Down
12 changes: 9 additions & 3 deletions test/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,21 @@
<PropertyGroup>
<IsPackable>false</IsPackable>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<UseMicrosoftTestingPlatformRunner>true</UseMicrosoftTestingPlatformRunner>

<!-- There's lots of use of internal EF Core APIs from the tests, suppress the analyzer warnings for those -->
<NoWarn>$(NoWarn);xUnit1003;xUnit1004;xUnit1013;xUnit1024;EF1001</NoWarn>
<NoWarn>$(NoWarn);CS0618;xUnit1003;xUnit1004;xUnit1008;xUnit1013;xUnit1024;xUnit1051;EF1001</NoWarn>
</PropertyGroup>

<PropertyGroup>
<OutputType>Exe</OutputType>
<TestRunnerName>XUnitV3</TestRunnerName>
<TestingPlatformCommandLineArguments>$(TestingPlatformCommandLineArguments) --filter-not-trait category=failing --ignore-exit-code 8</TestingPlatformCommandLineArguments>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.v3" />
<PackageReference Include="xunit.runner.visualstudio" />
<PackageReference Include="GitHubActionsTestLogger" />
<PackageReference Include="Npgsql" />
Expand All @@ -24,7 +31,6 @@

<ItemGroup>
<Using Include="Xunit" />
<Using Include="Xunit.Abstractions" />
<Using Include="Microsoft.EntityFrameworkCore.TestUtilities" />
<Using Include="Microsoft.EntityFrameworkCore.TestUtilities.Xunit" />
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions test/EFCore.PG.FunctionalTests/BuiltInDataTypesNpgsqlTest.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System.Collections.Immutable;
using System.Collections.Immutable;
using System.ComponentModel.DataAnnotations.Schema;
using System.Net.NetworkInformation;

Expand Down Expand Up @@ -719,7 +719,7 @@ private static void AssertNullMappedNullableDataTypes(MappedNullableDataTypes en
Assert.Null(entity.Mood);
}

[ConditionalFact(Skip = "DateTimeOffset with non-zero offset, https://github.com/dotnet/efcore/issues/26068")]
[ActiveIssue("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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1407,7 +1407,6 @@ 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);
Expand Down Expand Up @@ -1437,7 +1436,6 @@ 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);
Expand Down Expand Up @@ -1467,7 +1465,6 @@ 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);
Expand Down Expand Up @@ -1577,7 +1574,6 @@ WHERE c."CustomerID" LIKE 'F%'
""");
}

[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
public override async Task Update_with_two_inner_joins(bool async)
{
Expand Down
4 changes: 2 additions & 2 deletions test/EFCore.PG.FunctionalTests/ComputedColumnTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ public void Can_use_computed_columns_with_nullable_enum()

protected NpgsqlTestStore TestStore { get; private set; } = null!;

public async Task InitializeAsync()
public async ValueTask InitializeAsync()
=> TestStore = await NpgsqlTestStore.CreateInitializedAsync("ComputedColumnTest");

public async Task DisposeAsync()
public async ValueTask DisposeAsync()
=> await TestStore.DisposeAsync();
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ namespace Microsoft.EntityFrameworkCore;
public abstract class ConnectionInterceptionNpgsqlTestBase(ConnectionInterceptionNpgsqlTestBase.InterceptionNpgsqlFixtureBase fixture)
: ConnectionInterceptionTestBase(fixture)
{
[ConditionalTheory(Skip = "#2368")]
[ActiveIssue("#2368")]
public override Task Intercept_connection_creation_passively(bool async)
=> base.Intercept_connection_creation_passively(async);

[ConditionalTheory(Skip = "#2368")]
[ActiveIssue("#2368")]
public override Task Intercept_connection_creation_with_multiple_interceptors(bool async)
=> base.Intercept_connection_creation_with_multiple_interceptors(async);

[ConditionalTheory(Skip = "#2368")]
[ActiveIssue("#2368")]
public override Task Intercept_connection_to_override_connection_after_creation(bool async)
=> base.Intercept_connection_to_override_connection_after_creation(async);

[ConditionalTheory(Skip = "#2368")]
[ActiveIssue("#2368")]
public override Task Intercept_connection_to_override_creation(bool async)
=> base.Intercept_connection_to_override_creation(async);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Microsoft.EntityFrameworkCore;
namespace Microsoft.EntityFrameworkCore;

public class ConvertToProviderTypesNpgsqlTest : ConvertToProviderTypesTestBase<
ConvertToProviderTypesNpgsqlTest.ConvertToProviderTypesNpgsqlFixture>
Expand Down Expand Up @@ -49,7 +49,7 @@ public ConvertToProviderTypesNpgsqlTest(ConvertToProviderTypesNpgsqlFixture fixt
// }
// }

[ConditionalFact(Skip = "DateTimeOffset with non-zero offset, https://github.com/dotnet/efcore/issues/26068")]
[ActiveIssue("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;

Expand Down
4 changes: 2 additions & 2 deletions test/EFCore.PG.FunctionalTests/CustomConvertersNpgsqlTest.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Microsoft.EntityFrameworkCore;
namespace Microsoft.EntityFrameworkCore;

public class CustomConvertersNpgsqlTest(CustomConvertersNpgsqlTest.CustomConvertersNpgsqlFixture fixture)
: CustomConvertersTestBase<CustomConvertersNpgsqlTest.CustomConvertersNpgsqlFixture>(fixture)
Expand All @@ -7,7 +7,7 @@ public class CustomConvertersNpgsqlTest(CustomConvertersNpgsqlTest.CustomConvert
public override Task Can_insert_and_read_back_with_case_insensitive_string_key()
=> Task.CompletedTask;

[ConditionalFact(Skip = "DateTimeOffset with non-zero offset, https://github.com/dotnet/efcore/issues/26068")]
[ActiveIssue("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;

Expand Down
4 changes: 0 additions & 4 deletions test/EFCore.PG.FunctionalTests/JsonTypesNpgsqlTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ protected class NpgsqlDateOnlyCollectionType
public List<DateOnly> DateOnly { get; set; } = null!;
}

[ConditionalFact]
public override Task Can_read_write_collection_of_nullable_DateOnly_JSON_values()
=> Can_read_and_write_JSON_value<NullableDateOnlyCollectionType, List<DateOnly?>>(
nameof(NullableDateOnlyCollectionType.DateOnly),
Expand Down Expand Up @@ -462,7 +461,6 @@ 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);
Expand All @@ -480,7 +478,6 @@ 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);
Expand Down Expand Up @@ -511,7 +508,6 @@ await Can_read_and_write_JSON_value<PointZMType, Point>(
"""{"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);
Expand Down
5 changes: 2 additions & 3 deletions test/EFCore.PG.FunctionalTests/LazyLoadProxyNpgsqlTest.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Xunit.Sdk;
using Xunit.Sdk;

namespace Microsoft.EntityFrameworkCore;

Expand All @@ -15,10 +15,9 @@ public LazyLoadProxyNpgsqlTest(LoadNpgsqlFixture fixture)
public override void Can_serialize_proxies_to_JSON()
=> Assert.Throws<EqualException>(base.Can_serialize_proxies_to_JSON);

[ConditionalFact] // Requires MARS
public override void Top_level_projection_track_entities_before_passing_to_client_method() { }

[ConditionalTheory(Skip = "Possibly requires MARS, investigate")]
[ActiveIssue("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);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal;

namespace Microsoft.EntityFrameworkCore.Migrations;
Expand Down Expand Up @@ -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();

[ConditionalFact(Skip = "https://github.com/dotnet/efcore/issues/33056")]
[ActiveIssue("https://github.com/dotnet/efcore/issues/33056")]
public override void Can_apply_all_migrations()
=> base.Can_apply_all_migrations();

[ConditionalFact(Skip = "https://github.com/dotnet/efcore/issues/33056")]
[ActiveIssue("https://github.com/dotnet/efcore/issues/33056")]
public override void Can_apply_range_of_migrations()
=> base.Can_apply_range_of_migrations();

[ConditionalFact(Skip = "https://github.com/dotnet/efcore/issues/33056")]
[ActiveIssue("https://github.com/dotnet/efcore/issues/33056")]
public override void Can_revert_all_migrations()
=> base.Can_revert_all_migrations();

[ConditionalFact(Skip = "https://github.com/dotnet/efcore/issues/33056")]
[ActiveIssue("https://github.com/dotnet/efcore/issues/33056")]
public override void Can_revert_one_migrations()
=> base.Can_revert_one_migrations();

[ConditionalFact(Skip = "https://github.com/dotnet/efcore/issues/33056")]
[ActiveIssue("https://github.com/dotnet/efcore/issues/33056")]
public override Task Can_apply_all_migrations_async()
=> base.Can_apply_all_migrations_async();

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Npgsql.EntityFrameworkCore.PostgreSQL.Infrastructure;
using Npgsql.EntityFrameworkCore.PostgreSQL.Infrastructure;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata.Internal;
using Npgsql.EntityFrameworkCore.PostgreSQL.Scaffolding.Internal;
Expand Down Expand Up @@ -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]);""");
}

[ConditionalFact(Skip = "issue #33038")]
[ActiveIssue("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();
Expand Down Expand Up @@ -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[];""");
}

[ConditionalFact(Skip = "issue #33038")]
[ActiveIssue("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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

[ConditionalTheory(Skip = "https://github.com/dotnet/efcore/pull/27995/files#r874038747")]
[ActiveIssue("https://github.com/dotnet/efcore/pull/27995/files#r874038747")]
public override Task StoreType_for_UDF_used(bool async)
=> base.StoreType_for_UDF_used(async);
}
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,6 @@ public override async Task Index_out_of_bounds()

#region GroupBy

[ConditionalFact]
public override async Task GroupBy()
{
await base.GroupBy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ public override async Task Index_out_of_bounds()

#region GroupBy

[ConditionalFact]
public override async Task GroupBy()
{
await base.GroupBy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ public override async Task Index_out_of_bounds()

#region GroupBy

[ConditionalFact]
public override async Task GroupBy()
{
await base.GroupBy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ public override async Task Index_out_of_bounds()

#region GroupBy

[ConditionalFact]
public override async Task GroupBy()
{
await base.GroupBy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public virtual CompatibilityContext CreateRedshiftContext()
return new CompatibilityContext(builder.Options);
}

public virtual async Task InitializeAsync()
public virtual async ValueTask InitializeAsync()
{
_testStore = NpgsqlTestStoreFactory.Instance.GetOrCreate(StoreName);
await _testStore.InitializeAsync(null, CreateContext, c => CompatibilityContext.SeedAsync((CompatibilityContext)c));
Expand All @@ -85,7 +85,7 @@ public virtual void Dispose()
{
}

public virtual async Task DisposeAsync()
public virtual async ValueTask DisposeAsync()
=> await _testStore.DisposeAsync();
}

Expand Down
Loading
Loading