Files
RedBear-OS/local/recipes/shells/brush/source/scripts/summarize-pytest-results.py
T
vasilito 25fb843c40 brush: vendor the source tree (un-ignore) to complete the local fork
The prior commit switched the recipe to `[source] path = "source"`, but
.gitignore:77 still listed `local/recipes/shells/brush/source` (a leftover from
when brush was a transient upstream git fetch), so the vendored tree was not
tracked — a fresh clone would have no brush source and the build would fail.
Drop that ignore line and commit the vendored working tree (reubeno/brush @
897b373e, with the Redox port patches pre-applied). brush is now a durable
local fork like the other path=source recipes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-26 23:34:31 +09:00

49 lines
2.0 KiB
Python
Executable File

#!/usr/bin/python3
import argparse
import json
parser = argparse.ArgumentParser(description='Summarize pytest results')
parser.add_argument("-r", "--results", dest="results_file_path", type=str, required=True, help="Path to .json pytest results file")
parser.add_argument("--title", dest="title", type=str, default="Pytest results", help="Title to display")
args = parser.parse_args()
with open(args.results_file_path, "r") as results_file:
results = json.load(results_file)
summary = results["summary"]
error_count = summary.get("error") or 0
fail_count = summary.get("failed") or 0
pass_count = summary.get("passed") or 0
skip_count = summary.get("skipped") or 0
expected_fail_count = summary.get("xfailed") or 0
unexpected_pass_count = summary.get("xpassed") or 0
total_count = summary.get("total") or 0
collected_count = summary.get("collected") or 0
deselected_count = summary.get("deselected") or 0
#
# Output
#
print(f"# {args.title}")
print(f"| Outcome | Count | Percentage |")
print(f"| ------------------ | ----------------------: | ---------: |")
print(f"| ✅ Pass | {pass_count} | <span style='color:green'>{pass_count * 100 / total_count:.2f}</span> |")
if error_count > 0:
print(f"| ❗️ Error | {error_count} | <span style='color:red'>{error_count * 100 / total_count:.2f}</span> |")
if fail_count > 0:
print(f"| ❌ Fail | {fail_count} | <span style='color:red'>{fail_count * 100 / total_count:.2f}</span> |")
if skip_count > 0:
print(f"| ⏩ Skip | {skip_count} | {skip_count * 100 / total_count:.2f} |")
if expected_fail_count > 0:
print(f"| ❎ Expected Fail | {expected_fail_count} | {expected_fail_count * 100 / total_count:.2f} |")
if unexpected_pass_count > 0:
print(f"| ✔️ Unexpected Pass | {unexpected_pass_count} | <span style='color:red'>{unexpected_pass_count * 100 / total_count:.2f}</span> |")
print(f"| 📊 Total | {total_count} | {total_count * 100 / total_count:.2f} |")