Skip to content

Commit 137bf9c

Browse files
Joseph Edmondsclaude
andcommitted
fix(parser): Treat risky tests as failures, not informational
Risky tests indicate problems (tests with no assertions) and should fail the CI pipeline. This aligns with PHPUnit's --fail-on-risky flag behavior. Changes: - Exit with code 1 if risky tests detected (was: exit 0 with message) - Update comment to reflect that risky tests are failures - Remove risky count from success message (they now cause failure) This ensures risky tests fail in CI systems (like Huawei) that expect non-zero exit codes for test quality issues. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 9158562 commit 137bf9c

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

scripts/parse-junit-logs.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -557,15 +557,13 @@ def main():
557557
if stdout_data['warning_count'] > 0:
558558
print_warnings_breakdown(stdout_data)
559559

560-
# Exit with error code if there were failures or errors
561-
# Risky tests and warnings are informational, not failures
562-
if failures or errors:
560+
# Exit with error code if there were failures, errors, or risky tests
561+
# Risky tests indicate problems (no assertions, useless tests) and should fail the build
562+
if failures or errors or stdout_data['risky_count'] > 0:
563563
sys.exit(1)
564564
else:
565565
print("\n✓ All tests passed!")
566-
if stdout_data['risky_count'] > 0:
567-
print(f" (but {stdout_data['risky_count']} risky tests detected - see above)")
568-
elif stdout_data['incomplete_count'] > 0 or stdout_data['skipped_count'] > 0:
566+
if stdout_data['incomplete_count'] > 0 or stdout_data['skipped_count'] > 0:
569567
print(f" ({stdout_data['incomplete_count']} incomplete, {stdout_data['skipped_count']} skipped)")
570568
sys.exit(0)
571569

0 commit comments

Comments
 (0)