diff options
| author | _ov4 <ov4@ov4.one> | 2026-10-16 20:54:00 +0800 |
|---|---|---|
| committer | _ov4 <ov4@ov4.one> | 2026-10-16 20:54:00 +0800 |
| commit | 670b0d8a4669d939b09b4990be89173805831215 (patch) | |
| tree | 0a4ea2f071ed574b62782cb0002ddf6eec2bb5c3 /tests/summarize.py | |
| parent | f1f01c0622a9045e26335f5715a42342d0191dcd (diff) | |
ci(compiler): gate platform packages on reproducible compiler tests
Run all three suites on Linux, macOS and Windows with the push SHA as
seed. Retain failure evidence and document the 12 existing failures,
pending human review and remaining coverage gaps.
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, 41 insertions, 0 deletions
diff --git a/tests/summarize.py b/tests/summarize.py new file mode 100644 index 0000000..5006dc0 --- /dev/null +++ b/tests/summarize.py @@ -0,0 +1,41 @@ +#!/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) |
