fix: support recursive coverage and split postprocessing in pytest_main#1102
Draft
xangcastle wants to merge 1 commit into
Draft
fix: support recursive coverage and split postprocessing in pytest_main#1102xangcastle wants to merge 1 commit into
xangcastle wants to merge 1 commit into
Conversation
✨ Aspect Workflows Tasks📅 Thu Jun 11 12:41:04 UTC 2026 ❌ 3 failed tasks
✅ 3 successful tasks
🔁 Reproduce❌ test (test-e2e-bazel-9)❌ test (test-root-bazel-8 · test-root-bazel-9)Install ⏱ Last updated Thu Jun 11 13:18:34 UTC 2026 · 📊 GitHub API quota 285/15,000 (2% used, resets in 53m, throttle 3×) |
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.
Two related coverage failures in pytest.py.tmpl: first, when multiple pytest entry points run in the same process (e.g. ROS launch tests), a coverage.Coverage instance is already active when the template is imported a second time.
Creating a fresh one on top silently drops accumulated data, so we now check Coverage.current() and reuse the existing instance instead of starting a new one. Second, when --experimental_split_coverage_postprocessing is enabled Bazel sets COVERAGE_DIR and runs a separate postprocessor action that expects to find the raw coverage data at $COVERAGE_DIR/python_coverage.dat.
Previously the output was always written to COVERAGE_OUTPUT_FILE which the postprocessor never reads, so coverage was silently discarded, the fix prefers COVERAGE_DIR when it is set.
Changes are visible to end-users: no
Test plan