Skip to content

FIX: Fixing Build-Release-Package-Pipeline failure - #732

Merged
Subrata (subrata-ms) merged 1 commit into
mainfrom
subrata-ms/Release14Failure
Aug 28, 2026
Merged

FIX: Fixing Build-Release-Package-Pipeline failure#732
Subrata (subrata-ms) merged 1 commit into
mainfrom
subrata-ms/Release14Failure

Conversation

@subrata-ms

@subrata-ms Subrata (subrata-ms) commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Work Item / Issue Reference

AB#47683


Summary

Symptom
Build-Release-Package-Pipeline failed on all four Linux variants during Step 8 (pytest) with a collection-time error, before any test ran:
tests/test_fork_coverage_security.py:10: in
SPEC.loader.exec_module(coverage_comment)
E FileNotFoundError: [Errno 2] No such file or directory:
'/test_isolated_cp310/.github/scripts/prepare_fork_coverage_comment.py'
!!! Interrupted: 1 error during collection !!!

Combined with --maxfail=1, this aborted cp310–cp314 on:

  • Linux manylinux_2_28 x86_64
  • Linux manylinux_2_28 aarch64
  • Linux musllinux x86_64
  • Linux musllinux aarch64

Root cause
Two independent design assumptions collided:

  • Test-side assumption. [test_fork_coverage_security.py:7] resolves helpers at module top level (collection time) via [Path(file).parents[1] / ".github" / "scripts" / "prepare_fork_coverage_comment.py"], and also reads [forked-pr-coverage.yml] and [pr-code-coverage.yml]. It assumes [parents[1]] is a full repo checkout.

Pipeline-side assumption. The Linux release lane in [build-linux-single-stage.yml] intentionally runs pytest from an empty isolated directory to prove the installed wheel is self-contained:

TEST_DIR="/test_isolated_${PYBIN}"
rm -rf $TEST_DIR; mkdir -p $TEST_DIR
$PY -m pip install -q "$WHEEL"
cp -r /workspace/tests $TEST_DIR/
cp /workspace/pytest.ini $TEST_DIR/
cp /workspace/requirements.txt $TEST_DIR/

Only [tests], [pytest.ini], [requirements.txt] are copied. [.github] is not — until now no test needed anything outside [tests].
[test_fork_coverage_security.py] (added by the fork-coverage hardening series culminating in PR #714) is the first test that reaches outside [tests] at import time. In the isolated layout [parents[1]]= /test_isolated_cp310/, so the .github/… lookup fell off the map. Only the Linux lane runs the empty-isolated-dir model; Windows and macOS run from $(Build.SourcesDirectory) (a real checkout), so they were unaffected — and repo-root GitHub CI was unaffected too.

Fix:
Make the pipeline meet the test's assumption, and drop an earlier stop-gap.

Change added to Linux release pipeline
Copy [.github] into $TEST_DIR alongside [tests], in both the manylinux branch (covers x86_64 + aarch64) and the musllinux branch (covers x86_64 + aarch64):

[build-linux-single-stage.yml:322] — manylinux bash -lc block:

[build-linux-single-stage.yml:392] — musllinux sh -lc block: same two lines.

cp -r /workspace/tests $TEST_DIR/ || echo "WARNING: No tests directory";
Some tests read repo-side helper scripts/workflows (e.g. .github/scripts/prepare_fork_coverage_comment.py).
cp -r /workspace/.github $TEST_DIR/ || echo "WARNING: No .github directory";

These are the only two code sites reached by the four failing Linux stages.

Copilot AI lite review requested due to automatic review settings August 28, 2026 04:31

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.

Pull request overview

This PR updates the tests/test_fork_coverage_security.py integration/security tests to avoid failing in environments where the repository’s .github/scripts/prepare_fork_coverage_comment.py helper script is not present (e.g., release pipelines that run pytest against a tests-only snapshot).

Changes:

  • Add a module-level guard that skips the fork-coverage security test module when prepare_fork_coverage_comment.py cannot be found.

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

Comment thread tests/test_fork_coverage_security.py Outdated
@subrata-ms Subrata (subrata-ms) changed the title FIX: Fixing Build-Release-Package-Pipeline failure FIX:Fixing Build-Release-Package-Pipeline failure Aug 28, 2026
@subrata-ms Subrata (subrata-ms) changed the title FIX:Fixing Build-Release-Package-Pipeline failure FIX: Fixing Build-Release-Package-Pipeline failure Aug 28, 2026
@github-actions github-actions Bot added the pr-size: small Minimal code update label Aug 28, 2026
@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown

📊 Code Coverage Report

🔥 Diff Coverage

100%


🎯 Overall Coverage

82%


📈 Total Lines Covered: 7783 out of 9455
📁 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: 59.2%
mssql_python.pybind.ddbc_bindings.h: 61.5%
mssql_python.pybind.logger_bridge.hpp: 70.8%
mssql_python.pybind.ddbc_bindings.cpp: 75.5%
mssql_python.__init__.py: 77.6%
mssql_python.row.py: 77.6%
mssql_python.pybind.connection.connection_pool.cpp: 81.4%
mssql_python.pybind.connection.connection.cpp: 84.3%
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

The Linux release lane (both manylinux_2_28 and musllinux, x86_64 and
aarch64) runs pytest from an empty $TEST_DIR that only receives tests/,
pytest.ini, and requirements.txt. tests/test_fork_coverage_security.py
resolves .github/scripts/prepare_fork_coverage_comment.py and two
workflow files under .github/workflows/ via Path(__file__).parents[1],
which pointed at the empty isolated dir and raised FileNotFoundError at
collection time. Combined with --maxfail=1 this failed cp310-cp314 on
all four Linux variants (manylinux_2_28 x86_64/aarch64, musllinux
x86_64/aarch64).

Copy .github/ into $TEST_DIR alongside tests/ so the fork-coverage
security tests actually run in the release lane. Windows and macOS
release stages run from $(Build.SourcesDirectory) (real checkout) and
are unaffected.
@subrata-ms
Subrata (subrata-ms) force-pushed the subrata-ms/Release14Failure branch from cc6a508 to ac5438e Compare August 28, 2026 05:06
@subrata-ms
Subrata (subrata-ms) merged commit 3774fbb into main Aug 28, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-size: small Minimal code update

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants