[rc2] Fix tests for Azure SQL and SQL Server 2025#36631
[rc2] Fix tests for Azure SQL and SQL Server 2025#36631AndriySvyryd merged 1 commit intorelease/10.0from
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR fixes tests for Azure SQL and SQL Server 2025 by updating test utilities and fixtures to properly handle compatibility level requirements and provider selection.
Key Changes
- Replaces hardcoded connection string configuration with runtime provider selection
- Updates compatibility level handling to use appropriate provider (UseAzureSql vs UseSqlServer)
- Adds compatibility level checks for feature support detection
- Fixes test baselines for SQL Server 2025's new JSON type behavior
Reviewed Changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| TestEnvironment.cs | Adds compatibility level detection and renames IsSqlAzure to IsAzureSql |
| SqlServerTestStore.cs | Updates provider selection based on Azure SQL detection |
| Various test fixture files | Updates to use appropriate provider based on environment |
| Query test files | Updates SQL baselines for JSON type changes in SQL Server 2025 |
test/EFCore.SqlServer.FunctionalTests/TestUtilities/TestEnvironment.cs
Outdated
Show resolved
Hide resolved
7b768fd to
d17e25a
Compare
roji
left a comment
There was a problem hiding this comment.
Thanks @AndriySvyryd. We really should start testing on new SQL Server in CI soon to catch this kind of thing earlier.
| return TestEnvironment.SqlServerMajorVersion < 17 | ||
| ? options | ||
| : TestEnvironment.IsAzureSql | ||
| ? options.UseAzureSql(b => b.UseCompatibilityLevel(170)) |
There was a problem hiding this comment.
Was this was needed because UseSqlServer caused us to send JSON_VALUE with the RETURNING clause, which currently still isn't supported by Azure SQL? Just asking (no problem with the change)
There was a problem hiding this comment.
No, this doesn't change the behavior, it's just using the correct API for Azure
| return TestEnvironment.SqlServerMajorVersion < 17 | ||
| ? options | ||
| : TestEnvironment.IsAzureSql | ||
| ? options.UseAzureSql(b => b.UseCompatibilityLevel(170)) |
There was a problem hiding this comment.
Also since this is done in many places we may want to have a common utility
5e2d8d9 to
f760e2b
Compare
@artl93 Test-only change