FIX: Fixing Build-Release-Package-Pipeline failure - #732
Merged
Conversation
Contributor
There was a problem hiding this comment.
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.pycannot be found.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Subrata (subrata-ms)
requested review from
Gaurav Sharma (bewithgaurav),
gargsaumya,
Jahnvi Thakkar (jahnvi480) and
Sumit Sarabhai (sumitmsft)
August 28, 2026 04:35
📊 Code Coverage Report
Diff CoverageDiff: main...HEAD, staged and unstaged changesNo 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
|
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 (subrata-ms)
force-pushed
the
subrata-ms/Release14Failure
branch
from
August 28, 2026 05:06
cc6a508 to
ac5438e
Compare
Sumit Sarabhai (sumitmsft)
approved these changes
Aug 28, 2026
gargsaumya
approved these changes
Aug 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Work Item / Issue Reference
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:
Root cause
Two independent design assumptions collided:
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.