Skip to content

FIX: Validate built wheels outside source checkout - #753

Open
Gaurav Sharma (bewithgaurav) wants to merge 2 commits into
mainfrom
bewithgaurav/isolated-wheel-validation
Open

FIX: Validate built wheels outside source checkout#753
Gaurav Sharma (bewithgaurav) wants to merge 2 commits into
mainfrom
bewithgaurav/isolated-wheel-validation

Conversation

@bewithgaurav

@bewithgaurav Gaurav Sharma (bewithgaurav) commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Work Item / Issue Reference

ADO Work Item: Fixed AB#47858


Summary

Linux release jobs already install each built wheel in an isolated directory and run pytest against the installed artifact. Extend the same validation to Windows x64 and macOS so those stages test the final wheels instead of the source checkout. Windows ARM64 continues to build without execution because its wheels are cross-compiled on an x64 host.

Make source-dependent tests explicit in wheel-only layouts and run native ODBC resolver coverage against the installed package.

This PR depends on #749 for source-contract test compatibility with isolated wheel runs.

Validated by Build-Release-Package-Pipeline run 172314, with all Windows, macOS, and Linux stages passing.

Run Windows x64 and macOS release tests against the final installed wheel while preserving the Windows ARM64 cross-build limitation.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added the pr-size: medium Moderate update size label Sep 4, 2026
@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

📊 Code Coverage Report

🔥 Diff Coverage

100%


🎯 Overall Coverage

82%


📈 Total Lines Covered: 7772 out of 9444
📁 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.logger_bridge.cpp: 58.9%
mssql_python.pybind.ddbc_bindings.h: 61.5%
mssql_python.pybind.logger_bridge.hpp: 70.8%
mssql_python.pybind.ddbc_bindings.cpp: 75.6%
mssql_python.__init__.py: 77.6%
mssql_python.row.py: 77.6%
mssql_python.pybind.connection.connection_pool.cpp: 81.6%
mssql_python.pybind.connection.connection.cpp: 84.4%
mssql_python.logging.py: 85.5%
mssql_python.connection.py: 85.9%

🔗 Quick Links

⚙️ Build Summary 📋 Coverage Details

View Azure DevOps Build

Browse Full Coverage Report

@bewithgaurav
Gaurav Sharma (bewithgaurav) marked this pull request as ready for review September 4, 2026 10:14
Copilot AI lite review requested due to automatic review settings September 4, 2026 10:14

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The functional changes align with the stated goal of validating installed wheels, and the only finding is a minor error-message formatting nit in the Windows pipeline step.

Pull request overview

This PR updates CI validation so Windows x64 and macOS stages run pytest against the installed, built wheel from an isolated directory (matching existing Linux behavior), ensuring release validation exercises the packaged artifact rather than the source checkout.

Changes:

  • Update Windows x64 and macOS pipeline stages to build a wheel, install it, and run tests from a temp directory that cannot import mssql_python from the repo checkout.
  • Make source-checkout-only tests explicitly skip when running from an installed wheel layout.
  • Update the ODBC resolver negative-path test to detect the compiled extension from either an installed wheel or a source checkout.
File summaries
File Description
tests/test_025_odbc_package_required.py Detect installed mssql_python location via find_spec() and check for the native extension within that location.
tests/test_004_cursor.py Skip a source-only compilation test when the mssql_python/ source directory is not present.
OneBranchPipelines/stages/build-windows-single-stage.yml Build and test the wheel from an isolated temp directory on x64; keep ARM64 build-only behavior.
OneBranchPipelines/stages/build-macos-single-stage.yml Build, retag, install, and test the wheel from an isolated temp directory.
OneBranchPipelines/build-release-package-pipeline.yml Update stage documentation to reflect wheel-first validation outside the checkout.
Review details
  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.


$wheels = @(Get-ChildItem "$(Build.SourcesDirectory)\dist" -Filter *.whl -File)
if ($wheels.Count -ne 1) {
Write-Error "Expected one wheel in dist\, found $($wheels.Count)"
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.

3 participants