Repository navigation
Fix net8/net9 snapshot mismatches in filter tests - #10125
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes framework-specific snapshot selection and expectations in the filter test suites so they pass consistently across net8/net9 (EF Core 8/9) and net10/net11 (EF Core 10+), including parameter-name differences in generated SQL.
Changes:
- Update spatial filter tests to select
NET8_0_NET9_0snapshots viaTestEnvironment.Postfix(...), defaulting to the base snapshot for net10/net11 (except Distance, which keeps a net10-specific variant). - Refresh/add net8/net9 spatial snapshots to reflect EF Core 8/9 parameter naming (
@__p_0, etc.) and correct test-to-snapshot alignment. - Fix
Filter_With_Multi_Expressionto useEndsWith("0")(with CA1866 suppressed) so EF Core 8/9 translate it, and replace net8/net9 “expected failure” snapshots with a shared successfulNET8_0_NET9_0snapshot.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorWithinTests.cs | Switch snapshot selection to Postfix([NET8_0, NET9_0]) via static TestEnvironment import. |
| src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorTouchesTests.cs | Same snapshot selection change for Touches tests. |
| src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorOverlapsTests.cs | Same snapshot selection change for Overlaps tests. |
| src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorIntersectsTests.cs | Same snapshot selection change for Intersects tests. |
| src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorDistanceTests.cs | Use Postfix([NET8_0, NET9_0], [NET10_0]) to keep net10-specific snapshot while sharing net8/net9. |
| src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/QueryableFilterVisitorContainsTests.cs | Same snapshot selection change for Contains/NotContains tests. |
| src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/snapshots/QueryableFilterVisitorWithinTests.Create_Within_Query_NET8_0_NET9_0.snap | Update EF8/9 SQL parameter naming and correct function/geometry alignment. |
| src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/snapshots/QueryableFilterVisitorTouchesTests.Create_Touches_Query_NET8_0_NET9_0.snap | Update EF8/9 SQL parameter naming. |
| src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/snapshots/QueryableFilterVisitorOverlapsTests.Create_Overlaps_Query_NET8_0_NET9_0.snap | Update EF8/9 SQL parameter naming. |
| src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/snapshots/QueryableFilterVisitorIntersectsTests.Create_Intersects_Query_NET8_0_NET9_0.snap | Update EF8/9 SQL parameter naming. |
| src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/snapshots/QueryableFilterVisitorDistanceTests.Create_Distance_Expression_NET8_0_NET9_0.snap | Add EF8/9-specific snapshot for Distance expression parameter naming. |
| src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/snapshots/QueryableFilterVisitorContainsTests.Create_Contains_Expression_NET8_0_NET9_0.snap | Update EF8/9 SQL parameter naming. |
| src/HotChocolate/Spatial/test/Data.Filters.SqlServer.Tests/snapshots/QueryableFilterVisitorContainsTests.Create_NotContains_Expression_NET8_0_NET9_0.snap | Update EF8/9 SQL parameter naming. |
| src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/DataLoaderTests.cs | Share net8/net9 snapshot postfix and update query to EndsWith("0") for EF8/9 translation (CA1866 suppressed). |
| src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/snapshots/DataLoaderTests.Filter_With_Multi_Expression_NET8_0.md | Remove per-TFM net8 snapshot that captured translation failure details. |
| src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/snapshots/DataLoaderTests.Filter_With_Multi_Expression_NET9_0.md | Remove per-TFM net9 snapshot that captured translation failure details. |
| src/HotChocolate/Data/test/Data.Filters.SqlServer.Tests/snapshots/DataLoaderTests.Filter_With_Multi_Expression_NET8_0_NET9_0.md | Add shared net8/net9 snapshot capturing successful SQL + result. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Jul 23, 2026
chore(deps): Bump HotChocolate.Subscriptions.InMemory from 15.1.14 to 16.5.1
Kuestenlogik/Bowire#506
Merged
This was referenced Aug 1, 2026
This was referenced Aug 9, 2026
Merged
This was referenced Sep 1, 2026
[nuget][SUI_Matcher]- Bump the sui-package-updates group with 18 updates
DFE-Digital/SUI_Matcher#397
Closed
Closed
This was referenced Sep 15, 2026
Closed
[nuget][SUI_Matcher]- Bump the sui-package-updates group with 20 updates
DFE-Digital/SUI_Matcher#405
Closed
This was referenced Sep 22, 2026
Closed
Closed
[nuget][SUI_Matcher]- Bump the sui-package-updates group with 20 updates
DFE-Digital/SUI_Matcher#410
Merged
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
@__p_0parameter naming) and net10/net11 (EF 10+,@p). Both filter test suites only carried the EF 10+ variants, so their tests failed on net8/net9, which CI (net11 only) never runs.Data.Filters.SqlServer.Tests:Filter_With_Multi_Expressionnow uses the string overloadEndsWith("0")(CA1866 suppressed), which EF Core 8/9 can translate, and matches a sharedNET8_0_NET9_0snapshot. This replaces per-TFM snapshots that recorded an expected translation failure with machine-specific stack traces.Data.Filters.SqlServer.Tests: tests select snapshots via thePostfixhelper — net8/net9 share an EF 8/9 variant, net10/net11 use the base, and the Distance test keeps aNET10_0variant because EF 10 and EF 11 name the second parameter differently (@p0vs@p1).Test plan
dotnet testforData.Filters.SqlServer.Tests: 364/364 across all four target frameworks.dotnet testfor the spatialData.Filters.SqlServer.Tests(PostgreSQL/PostGIS containers): 28/28 across all four target frameworks.