Skip to content

Conversation

@bewithgaurav
Copy link
Collaborator

@bewithgaurav bewithgaurav commented Oct 29, 2025

Work Item / Issue Reference

AB#39997


Summary

This pull request updates the pr-validation-pipeline.yml to enhance test coverage and CI flexibility by adding matrix builds for multiple SQL Server environments (LocalDB, SQL Server 2022, and Azure SQL Database) on Windows, and by introducing support for SQL Server 2025 on Linux via Docker. The changes ensure that tests are run and results are published for each supported SQL backend, improving reliability and compatibility testing.

Windows build matrix and test orchestration:

  • Added a build matrix to run jobs against both LocalDB and SQL Server 2022 on Windows, allowing the pipeline to test against multiple SQL Server versions in parallel.
  • Added conditional steps to install and configure either LocalDB or SQL Server 2022 Express, including database and user setup scripts tailored for each environment.
  • Updated test execution to run pytest separately for each SQL backend (LocalDB, SQL Server 2022, and optionally Azure SQL Database), with unique result and coverage file names for each run.
  • Modified test result publishing to aggregate results from all matrix jobs, improving clarity in CI reporting.

Linux build matrix and SQL Server version support:

  • Extended the Linux build matrix to include SQL Server 2025 (via Docker), and parameterized the SQL Server image used in each job, enabling future SQL Server version testing with minimal changes. [1] [2]

Copilot AI review requested due to automatic review settings October 29, 2025 10:04
@github-actions github-actions bot added the pr-size: medium Moderate update size label Oct 29, 2025
Copy link
Contributor

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 enhances the CI/CD pipeline to expand SQL Server version coverage and introduce matrix-based testing. The changes add support for testing against multiple SQL Server versions including LocalDB, SQL Server 2022, SQL Server 2025, and Azure SQL Database.

Key Changes

  • Added matrix strategy for Windows testing to run tests against both LocalDB and SQL Server 2022
  • Introduced SQL Server 2025 preview testing for Linux environments
  • Enhanced test result aggregation with version-specific naming for better traceability
Comments suppressed due to low confidence (2)

eng/pipelines/pr-validation-pipeline.yml:363

  • The condition only checks for 'Ubuntu' but now there are two Ubuntu matrix entries: 'Ubuntu' and 'Ubuntu-SQL2025'. The 'Ubuntu-SQL2025' entry will fall into the 'else' branch and be treated as Debian, which is incorrect. Update the condition to handle both Ubuntu variants, for example: if [[ "$(distroName)" == Ubuntu* ]]; then
      if [ "$(distroName)" = "Ubuntu" ]; then

eng/pipelines/pr-validation-pipeline.yml:389

  • Similar to the previous issue, this condition only matches 'Ubuntu' exactly and will not match 'Ubuntu-SQL2025'. The Ubuntu-SQL2025 matrix entry will incorrectly use the Debian package configuration. Update to handle both Ubuntu variants: if [[ '$(distroName)' == Ubuntu* ]]; then
        if [ '$(distroName)' = 'Ubuntu' ]; then

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions
Copy link

github-actions bot commented Oct 29, 2025

📊 Code Coverage Report

🔥 Diff Coverage

100%


🎯 Overall Coverage

77%


📈 Total Lines Covered: 4623 out of 5965
📁 Project: mssql-python


Diff Coverage

Diff: main...HEAD, staged and unstaged changes

No lines with coverage information in this diff.


📋 Files Needing Attention

📉 Files with overall lowest coverage (click to expand)
mssql_python.pybind.ddbc_bindings.cpp: 70.7%
mssql_python.row.py: 77.9%
mssql_python.ddbc_bindings.py: 79.6%
mssql_python.pybind.connection.connection.cpp: 81.2%
mssql_python.connection.py: 82.9%
mssql_python.cursor.py: 83.6%
mssql_python.pybind.connection.connection_pool.cpp: 84.8%
mssql_python.auth.py: 87.1%
mssql_python.pooling.py: 87.7%
mssql_python.exceptions.py: 92.1%

🔗 Quick Links

⚙️ Build Summary 📋 Coverage Details

View Azure DevOps Build

Browse Full Coverage Report

@bewithgaurav bewithgaurav changed the title FEAT: Expand CI Testing to add new SQL Server Versions and Types FEAT: Expand CI Testing to add new SQL Server Versions Oct 30, 2025
conn.close()


def test_timeout_long_query(db_connection):
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

deleted duplicate test

cursor.fetchall()
elapsed_time = time.perf_counter() - start_time
# Retry this method multiple times if we get DataError (arithmetic overflow)
while retry_count < max_retries:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

retry logic since this is a flaky test

Write-Host "Downloading SQL Server 2022 Express..."
# Download SQL Server 2022 Express installer
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest -Uri "https://go.microsoft.com/fwlink/p/?linkid=2216019" -OutFile "SQL2022-SSEI-Expr.exe"

Choose a reason for hiding this comment

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

A maintenance note. When a new version of SQL, esp CU is released, this old URL typically becomes ineffective.
We have 1ES images which leverage similar script for download and install of SQL. There is a central team which updates these URLs regularly.

This comment is FYI. You can't do anything about it. But if one fine day, the CI starts failing then you know what to do 😄

Copy link

@saurabh500 saurabh500 left a comment

Choose a reason for hiding this comment

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

Left a comment FYI. nothing to do. Make a note in any maintenance docs or perhaps add a comment in the script. 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-size: medium Moderate update size

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants