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
10 changes: 8 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ jobs:

- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v5
with:
global-json-file: global.json

- name: Build
run: dotnet build --configuration Debug
Expand Down Expand Up @@ -96,7 +98,7 @@ jobs:

# Install PostgreSQL
echo "Installing PostgreSQL (version: ${EDB_VERSION})"
curl -o pgsql.zip -L https://get.enterprisedb.com/postgresql/postgresql-${EDB_VERSION}-windows-x64-binaries.zip
curl --fail --retry 5 --retry-all-errors -o pgsql.zip -L https://get.enterprisedb.com/postgresql/postgresql-${EDB_VERSION}-windows-x64-binaries.zip
unzip pgsql.zip -x 'pgsql/include/**' 'pgsql/doc/**' 'pgsql/pgAdmin 4/**' 'pgsql/StackBuilder/**'

# Match Npgsql CI Docker image and stash one level up
Expand All @@ -112,7 +114,7 @@ jobs:
shell: bash

- name: Test
run: dotnet test -c ${{ matrix.config }} --logger "GitHubActions;report-warnings=false"
run: dotnet test -c ${{ matrix.config }} --filter-not-trait category=failing
shell: bash
Comment on lines 116 to 118
env:
# Disable SSL to avoid unnecessary handshake pressure in the Windows functional tests.
Expand Down Expand Up @@ -143,6 +145,8 @@ jobs:

- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v5
with:
global-json-file: global.json

- name: Pack
run: dotnet pack --configuration Release --property:PackageOutputPath="$PWD/nupkgs" --version-suffix "ci.$(date -u +%Y%m%dT%H%M%S)+sha.${GITHUB_SHA:0:9}" -p:ContinuousIntegrationBuild=true
Expand Down Expand Up @@ -177,6 +181,8 @@ jobs:

- name: Setup .NET Core SDK
uses: actions/setup-dotnet@v5
with:
global-json-file: global.json

- name: Pack
run: dotnet pack --configuration Release --property:PackageOutputPath="$PWD/nupkgs" -p:ContinuousIntegrationBuild=true
Expand Down
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<VersionPrefix>11.0.0-preview.5</VersionPrefix>
<VersionPrefix>11.0.0-preview.6</VersionPrefix>
<TargetFramework>net11.0</TargetFramework>
<LangVersion>latest</LangVersion>
<Nullable>enable</Nullable>
Expand Down
12 changes: 5 additions & 7 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.26311.105</EFCoreVersion>
<MicrosoftExtensionsVersion>11.0.0-preview.5.26311.105</MicrosoftExtensionsVersion>
<MicrosoftExtensionsConfigurationVersion>11.0.0-preview.5.26311.105</MicrosoftExtensionsConfigurationVersion>
<EFCoreVersion>11.0.0-preview.6.26311.113</EFCoreVersion>
<MicrosoftExtensionsVersion>11.0.0-preview.6.26311.113</MicrosoftExtensionsVersion>
<MicrosoftExtensionsConfigurationVersion>11.0.0-preview.6.26311.113</MicrosoftExtensionsConfigurationVersion>
<NpgsqlVersion>10.0.3</NpgsqlVersion>
</PropertyGroup>

Expand All @@ -28,11 +28,9 @@

<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="10.0.300" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
<PackageVersion Include="xunit" Version="2.9.3" />
<PackageVersion Include="xunit.assert" Version="2.9.3" />
<PackageVersion Include="xunit.core" Version="2.9.3" />
<PackageVersion Include="xunit.v3" Version="4.0.0-pre.108" />
<PackageVersion Include="xunit.v3.runner.inproc.console" Version="4.0.0-pre.108" />
<PackageVersion Include="xunit.runner.visualstudio" Version="4.0.0-pre.4" />
<PackageVersion Include="GitHubActionsTestLogger" Version="3.0.4" />
<PackageVersion Include="Testcontainers.PostgreSql" Version="4.10.0" />
</ItemGroup>
</Project>
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.XUnitV3Extensions" />
</packageSource>
</packageSourceMapping>

</configuration>
Empty file added empty
Empty file.
6 changes: 4 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"sdk": {
"version": "11.0.100-preview.4.26210.111",
"rollForward": "latestMinor",
"version": "11.0.100-preview.6.26313.102",
"allowPrerelease": true
},
"test": {
"runner": "Microsoft.Testing.Platform"
}
}
4 changes: 3 additions & 1 deletion src/EFCore.PG/Update/Internal/NpgsqlUpdateSqlGenerator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ protected override void AppendUpdateColumnValue(
Check.DebugAssert(columnModification.TypeMapping.StoreType is "jsonb", "Non-jsonb type mapping in JSON partial update");

var jsonPath = columnModification.JsonPath;
var indices = jsonPath.Indices;

// TODO: Lax or not?
stringBuilder
Expand All @@ -166,7 +167,8 @@ protected override void AppendUpdateColumnValue(

if (segment.IsArray)
{
stringBuilder.Append(jsonPath.Indices[ordinalIndex++]);
Check.DebugAssert(indices is not null, "Array segment found in JSON path with no indices");
stringBuilder.Append(indices[ordinalIndex++]);
}
else
{
Expand Down
8 changes: 4 additions & 4 deletions test/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@
<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>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" />
<PackageReference Include="xunit" />
<PackageReference Include="xunit.v3" />
<PackageReference Include="xunit.v3.runner.inproc.console" />
<PackageReference Include="xunit.runner.visualstudio" />
<PackageReference Include="GitHubActionsTestLogger" />
<PackageReference Include="Npgsql" />
</ItemGroup>

Expand All @@ -24,7 +25,6 @@

<ItemGroup>
<Using Include="Xunit" />
<Using Include="Xunit.Abstractions" />
<Using Include="Microsoft.EntityFrameworkCore.TestUtilities" />
<Using Include="Microsoft.EntityFrameworkCore.TestUtilities.Xunit" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -719,7 +719,6 @@ private static void AssertNullMappedNullableDataTypes(MappedNullableDataTypes en
Assert.Null(entity.Mood);
}

[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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -613,15 +613,19 @@ public override async Task Delete_with_RightJoin(bool async)
DELETE FROM "Order Details" AS o
WHERE EXISTS (
SELECT 1
FROM "Order Details" AS o0
FROM (
SELECT o1."OrderID", o1."ProductID"
FROM "Order Details" AS o1
WHERE o1."OrderID" < 10276
) AS o0
RIGHT JOIN (
SELECT o2."OrderID"
FROM "Orders" AS o2
WHERE o2."OrderID" < 10300
ORDER BY o2."OrderID" NULLS FIRST
SELECT o3."OrderID"
FROM "Orders" AS o3
WHERE o3."OrderID" < 10300
ORDER BY o3."OrderID" NULLS FIRST
LIMIT @p1 OFFSET @p
) AS o1 ON o0."OrderID" = o1."OrderID"
WHERE o0."OrderID" < 10276 AND o0."OrderID" = o."OrderID" AND o0."ProductID" = o."ProductID")
) AS o2 ON o0."OrderID" = o2."OrderID"
WHERE o0."OrderID" = o."OrderID" AND o0."ProductID" = o."ProductID")
""");
}

Expand Down Expand Up @@ -1318,25 +1322,28 @@ await AssertUpdate(
e => e.Order,
s => s.SetProperty(t => t.Order.OrderDate, new DateTime(2020, 1, 1, 0, 0, 0)),
rowsAffectedCount: 2,
(b, a) => Assert.All(a, o => Assert.Equal(new DateTime(2020, 1, 1, 0, 0, 0), o.OrderDate)));
(b, a) => Assert.All(a.Where(o => o is not null), o => Assert.Equal(new DateTime(2020, 1, 1, 0, 0, 0), o.OrderDate)));

AssertExecuteUpdateSql(
"""
@p='2020-01-01T00:00:00.0000000' (Nullable = true)

UPDATE "Orders" AS o0
UPDATE "Orders" AS o1
SET "OrderDate" = @p
FROM (
SELECT o."OrderID"
FROM "Orders" AS o
SELECT o0."OrderID"
FROM (
SELECT o."OrderID", o."CustomerID"
FROM "Orders" AS o
WHERE o."OrderID" < 10300
) AS o0
RIGHT JOIN (
SELECT c."CustomerID"
FROM "Customers" AS c
WHERE c."CustomerID" LIKE 'F%'
) AS c0 ON o."CustomerID" = c0."CustomerID"
WHERE o."OrderID" < 10300
) AS c0 ON o0."CustomerID" = c0."CustomerID"
) AS s
WHERE o0."OrderID" = s."OrderID"
WHERE o1."OrderID" = s."OrderID"
""");
}

Expand Down Expand Up @@ -1407,7 +1414,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 +1443,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 +1472,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,8 +1581,6 @@ WHERE c."CustomerID" LIKE 'F%'
""");
}

[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
public override async Task Update_with_two_inner_joins(bool async)
{
await AssertUpdate(
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();
}
Loading