Skip to content

Commit f028254

Browse files
committed
Remove pytest results from prepare_comment script
Pytest results handling and reporting have been removed from the prepare_comment.py script as they are not working properly. The overall result now only reflects the Inspect AI quality gate status.
1 parent 06b3706 commit f028254

File tree

1 file changed

+8
-31
lines changed

1 file changed

+8
-31
lines changed

tests/inspect-ai/scripts/prepare_comment.py

Lines changed: 8 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,8 @@ def prepare_comment(summary_path: Union[str, Path]) -> int:
2525
with open(summary_path, "r") as f:
2626
inspect_results = json.load(f)
2727

28-
# Try to read the pytest averaged summary
28+
# Skip pytest results for now since they're not working properly
2929
pytest_results = None
30-
pytest_summary_path = summary_path.parent / "pytest_summary.json"
31-
print(f"Looking for pytest summary at: {pytest_summary_path}")
32-
if pytest_summary_path.exists():
33-
with open(pytest_summary_path, "r") as f:
34-
pytest_results = json.load(f)
35-
print(f"Found pytest results: {pytest_results}")
36-
else:
37-
print(
38-
f"Pytest summary not found. Directory contents: {list(summary_path.parent.iterdir())}"
39-
)
4030

4131
# Try to read the combined summary for overall gate status
4232
combined_results = None
@@ -63,26 +53,13 @@ def prepare_comment(summary_path: Union[str, Path]) -> int:
6353
f"- **Quality Gate**: {'✅ PASSED' if inspect_results['quality_gate_passed'] else '❌ FAILED'} (≥80% required)\n"
6454
)
6555

66-
# Pytest section
67-
if pytest_results:
68-
comment_parts.append("### 🧪 Pytest Execution Results")
69-
comment_parts.append(f"- **Passed**: {pytest_results['passed']:.1f}")
70-
comment_parts.append(f"- **Failed**: {pytest_results['failed']:.1f}")
71-
comment_parts.append(f"- **Errors**: {pytest_results['errors']:.1f}")
72-
comment_parts.append(f"- **Skipped**: {pytest_results['skipped']:.1f}")
73-
comment_parts.append(
74-
f"- **Pass Rate**: {pytest_results['passed']:.1f}/{pytest_results['total']:.1f} ({pytest_results['pass_rate']:.1f}%)\n"
75-
)
76-
77-
# Overall status
78-
if combined_results:
79-
overall_passed = combined_results.get("overall_quality_gate_passed", False)
80-
comment_parts.append("### 🎯 Overall Result")
81-
comment_parts.append(
82-
f"**{'✅ PASSED' if overall_passed else '❌ FAILED'}** - Combined quality gate"
83-
)
84-
if pytest_results:
85-
comment_parts.append("(Requires: Inspect AI ≥80% + Pytest ≥85%)")
56+
# Pytest section removed - not working properly
57+
58+
# Overall status - just use inspect-ai quality gate for now
59+
comment_parts.append("### 🎯 Overall Result")
60+
comment_parts.append(
61+
f"**{'✅ PASSED' if inspect_results['quality_gate_passed'] else '❌ FAILED'}** - Quality gate based on Inspect AI results"
62+
)
8663

8764
comment_parts.append("\n---")
8865
comment_parts.append(

0 commit comments

Comments
 (0)