Repository navigation
Fix tests that fail when running all target frameworks - #10435
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
No unresolved issues were identified that would block approval.
Review effort: Lite
Findings: None
What changed in this PR
Updates multi-target test infrastructure so tests pass consistently on .NET 8–11.
Changes:
- Refreshes PostgreSQL type metadata after SQL scripts.
- Adds framework-specific EF Core SQL snapshots.
- Isolates CookieCrumble snapshots by target framework.
| File | Description |
|---|---|
| src/HotChocolate/Data/test/Data.EntityFramework.Tests/IsProjectedSelectorTests.cs | Updated as part of this pull request. |
| src/CookieCrumble/test/CookieCrumble.Tests/SnapshotTests.cs | Updated as part of this pull request. |
| src/CookieCrumble/src/CookieCrumble.Resources.PostgreSql/PostgreSqlResource.cs | Updated as part of this pull request. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
Patch coverage100.0% of changed lines covered (1/1)
Project coverage: 58.9% (300422/510417 lines) |
This was referenced Oct 25, 2026
Merged
This was referenced Nov 1, 2026
This was referenced Nov 2, 2026
Closed
[nuget][SUI_Matcher]- Bump the sui-package-updates group with 21 updates
DFE-Digital/SUI_Matcher#424
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
CI tests net11.0 only, so these failures show up only when the suite runs on every target framework.
PostgreSqlResource.RunSqlScriptAsyncopens its connection before the script runs, so Npgsql caches the database's types for that connection string without the ones the script creates (geometry, fromCREATE EXTENSION postgis). EF Core 8 reuses that cache and fails withThe NpgsqlDbType 'Geometry' isn't present in your database.RunSqlScriptAsyncnow callsReloadTypes()after the script. The stale cache exists in every Npgsql version, so the reload runs on all target frameworks. It uses the synchronous overload because the resource compiles against Npgsql 8.0.7, while 9.0.x and 10.0.0 to 10.0.2 only haveReloadTypesAsync(CancellationToken). Squadron ran scripts throughpsqlinside the container, so this started with Replace Squadron with CookieCrumble Testcontainers resources #10338.IsProjectedSelectorTestson net8.0 and net9.0. EF Core 8 and 9 translate the DataLoader key lookup toIN (SELECT ... json_each(...)), so the test now has that SQL as the inline snapshot for those target frameworks.Match_StrictMode_Offflake. The test creates and deletes snapshot files whose names were shared by every target framework's test process, so one process could read a file another had just written. The global formatter registered bySnapshotBuilder_Segment_Custom_Global_Serializermade the contents differ when the two processes ran the tests in a different order. The file names now include the target framework.Test plan
IsProjectedSelectorTests, and the CookieCrumble tests pass on net8.0, net9.0, net10.0, and net11.0.geometryas an unknown type, and aspublic.geometryafterReloadTypes().