Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

FEAT: Expand CI Testing to add new SQL Server Versions #308

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
bewithgaurav wants to merge 10 commits into main
base: main
Choose a base branch
Loading
from bewithgaurav/enhance_sql_testing

Conversation

@bewithgaurav
Copy link
Collaborator

@bewithgaurav bewithgaurav commented Oct 29, 2025
edited by azure-boards bot
Loading

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.

Copy link

github-actions bot commented Oct 29, 2025
edited
Loading

📊 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

@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

@bewithgaurav bewithgaurav Oct 30, 2025

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

@bewithgaurav bewithgaurav Oct 30, 2025

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"
Copy link

@saurabh500 saurabh500 Oct 30, 2025

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

Reviewers

Copilot code review Copilot Copilot left review comments

@saurabh500 saurabh500 saurabh500 approved these changes

@jahnvi480 jahnvi480 jahnvi480 approved these changes

@sumitmsft sumitmsft sumitmsft approved these changes

At least 2 approving reviews are required to merge this pull request.

Assignees

No one assigned

Labels

pr-size: medium Moderate update size

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /