Skip to content

Conversation

AndriySvyryd
Copy link
Member

@AndriySvyryd AndriySvyryd commented Aug 21, 2025

@artl93 Test-only change

@AndriySvyryd AndriySvyryd requested review from a team and Copilot August 22, 2025 00:13
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Member

@roji roji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also since this is done in many places we may want to have a common utility

@AndriySvyryd AndriySvyryd enabled auto-merge (squash) August 22, 2025 20:33
@AndriySvyryd AndriySvyryd merged commit 6b9d491 into release/10.0 Aug 22, 2025
7 checks passed
@AndriySvyryd AndriySvyryd deleted the AzureTests branch August 22, 2025 21:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants