ai-summary: don't capture adjacent test on bare FAILED line#132
Merged
Conversation
The failed_test_patterns rule `FAILED\s+(\S+::\S+)` used `\s`, which matches newlines. pytest -vvv prints a bare `FAILED` status word on its own line; the regex then bound it to the *next* line's node id. When that neighbour was another test's result (e.g. an adjacent SKIPPED test), it got reported and counted as a failure. Constrain to same-line whitespace (`[ \t]+`) so the node id must follow `FAILED` on the same line. The real `short test summary info` line (`FAILED path::test - reason`) still matches. Repro from run 26948207149 (bh_lb_DeepSeek_PREFILL_PERF): summary said "2 failed" listing test_deepseek_v3_mla_perf_galaxy (SKIPPED) alongside the real test_deepseek_v3_mla_perf_loudbox failure. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes a false-positive failure extraction bug in the AI job summary tool where a regex could match across newlines and incorrectly bind a bare FAILED status line to the next line’s test node id (e.g., an adjacent SKIPPED test), inflating failure counts.
Changes:
- Update
failed_test_patternsto restrict whitespace afterFAILEDto same-line spaces/tabs ([ \t]+) instead of\s+(which can match newlines). - Add a regression fixture log demonstrating the
FAILED-then-adjacent-SKIPPEDscenario. - Add a unit test that loads the real bundled config and asserts only the true failed test is captured.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
.github/actions/ai_summary/tool/ai_job_summary/tests/test_extraction.py |
Adds regression coverage to ensure failed-test extraction doesn’t jump to adjacent tests across newlines. |
.github/actions/ai_summary/tool/ai_job_summary/tests/fixtures/log_samples/pytest_failed_adjacent_skip.txt |
New pytest output fixture reproducing the bare FAILED line followed by a SKIPPED test line. |
.github/actions/ai_summary/tool/ai_job_summary/config/analysis.yaml |
Tightens the FAILED ... regex to prevent newline-crossing matches while still matching pytest short summary lines. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
vmilosevic
approved these changes
Jun 15, 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.
The failed_test_patterns rule
FAILED\s+(\S+::\S+)used\s, which matches newlines. pytest -vvv prints a bareFAILEDstatus word on its own line; the regex then bound it to the next line's node id. When that neighbour was another test's result (e.g. an adjacent SKIPPED test), it got reported and counted as a failure.Constrain to same-line whitespace (
[ \t]+) so the node id must followFAILEDon the same line. The realshort test summary infoline (FAILED path::test - reason) still matches.Repro from run 26948207149 (bh_lb_DeepSeek_PREFILL_PERF): summary said "2 failed" listing test_deepseek_v3_mla_perf_galaxy (SKIPPED) alongside the real test_deepseek_v3_mla_perf_loudbox failure.