Add --test-show-all-batch-targets to expose all targets in batched pytest#23225
Open
jasonwbarnett wants to merge 4 commits intopantsbuild:mainfrom
Open
Add --test-show-all-batch-targets to expose all targets in batched pytest#23225jasonwbarnett wants to merge 4 commits intopantsbuild:mainfrom
jasonwbarnett wants to merge 4 commits intopantsbuild:mainfrom
Conversation
…ed pytest runs When tests are batched via `batch_compatibility_tag`, the output only shows the first target plus a count (e.g. "path/to:tests and 3 other files"), making it impossible to determine which targets are grouped in each pytest invocation. This adds a `--test-show-all-batch-targets` flag that, when enabled, lists all target addresses in test summaries, workunit descriptions, and warning messages. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Without this, test_test.py tests that exercise the run_tests goal rule would fail with an AttributeError when accessing the new option. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
86ff629 to
c16ed25
Compare
sureshjoshi
requested changes
Apr 21, 2026
Member
sureshjoshi
left a comment
There was a problem hiding this comment.
Thanks for the contribution. We've just branched for 2.32.x, so merging this pull request now will come out in 2.33.x, please move the release notes updates to docs/notes/2.33.x.md if that's appropriate.
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.
Summary
--test-show-all-batch-targetsCLI flag (default:False) to the[test]subsystem"path/to:tests and 3 other files"Problem
When
python_teststargets usebatch_compatibility_tag, multiple targets are grouped into a single pytest invocation. The output only shows the first target plus a count (e.g."batch of path/to:tests and 3 other files"), making it impossible to determine which specific targets are grouped together in each pytest process.In practice, this is a real pain point when batched test runs hang or timeout in CI. A long-running batch that never finishes gives you no way to identify which specific targets in that batch are responsible. You're left guessing across potentially dozens of targets, manually bisecting to find the culprit. This flag makes that debugging tractable by showing exactly which targets are in each batch.
Solution
A new
--test-show-all-batch-targetsflag that, when enabled, replaces the truncated descriptions with comma-separated lists of all target addresses in three locations:✓ path/to:tests, path/to:tests2, path/to:tests3 succeeded)Run Pytest for path/to:tests, path/to:tests2, path/to:tests3)Test plan
--test-show-all-batch-targetslists all addresses in test summaries🤖 Generated with Claude Code