diff options
| author | _ov4 <ov4@ov4.org> | 2026-10-16 17:47:27 +0000 |
|---|---|---|
| committer | _ov4 <ov4@ov4.org> | 2026-10-16 17:47:27 +0000 |
| commit | 06529b7995b5e665b0b5cee2bd7ec83a16816eba (patch) | |
| tree | 1ef89540be581be8582d57d70bc71adadaac1aa9 /tests/summarize.py | |
| parent | 6b90cec14aa90cb9e840aa0ca659078a0c2615a5 (diff) | |
test(harness): port summarize to Perl
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Diffstat (limited to 'tests/summarize.py')
| -rw-r--r-- | tests/summarize.py | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/tests/summarize.py b/tests/summarize.py deleted file mode 100644 index 5006dc0..0000000 --- a/tests/summarize.py +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env python3 -"""Summarize retained case results locally and in GitHub Actions.""" - -import argparse -import json -import os -from pathlib import Path - - -def summarize(directory): - results = [json.loads(path.read_text(encoding="utf-8")) - for path in sorted(directory.glob("*/*/result.json"))] - if not results: - return "No compiler case results were produced; inspect the build/CTest log.\n" - failures = [result for result in results if not result["passed"]] - lines = [f"Compiler cases: {len(results) - len(failures)}/{len(results)} passed.", "", - "| Group | Passed | Total |", "|---|---:|---:|"] - for suite in ["i", "ii", "iii"]: - subset = [result for result in results if result["case"].startswith(suite + "/")] - lines.append(f"| {suite} | {sum(result['passed'] for result in subset)} | {len(subset)} |") - lines += ["", f"Commit: `{results[0]['commit']}`. Seed: `{results[0]['seed']}`.", - "Fixed expectations: pending human review."] - if failures: - lines += ["", "Failures:", ""] - for result in failures: - stages = ", ".join(failure["stage"] for failure in result["failures"]) - lines.append(f"- `{result['case']}` ({stages}); see its `result.json` and command logs.") - return "\n".join(lines) + "\n" - - -if __name__ == "__main__": - parser = argparse.ArgumentParser(description=__doc__) - parser.add_argument("directory", type=Path) - args = parser.parse_args() - summary = summarize(args.directory) - print(summary, end="") - args.directory.mkdir(parents=True, exist_ok=True) - (args.directory / "summary.md").write_text(summary, encoding="utf-8") - if os.environ.get("GITHUB_STEP_SUMMARY"): - with open(os.environ["GITHUB_STEP_SUMMARY"], "a", encoding="utf-8") as output: - output.write(summary) |
