mirror of
https://github.com/Abdess/retroarch_system.git
synced 2026-10-17 17:03:27 -05:00
feat: let verify fail on a missing required file
This commit is contained in:
1 parent
4544006aff
commit
f6b808b1d9
4 files changed
+63
-1
No files matched your search
+1
-1
@@ -450,7 +450,7 @@ def main():
|
||||
all_ok = _truth_steps(args, results) and all_ok
|
||||
|
||||
# Step 3: Verify
|
||||
verify_cmd = [sys.executable, "scripts/verify.py", "--all"]
|
||||
verify_cmd = [sys.executable, "scripts/verify.py", "--all", "--strict"]
|
||||
if args.include_archived:
|
||||
verify_cmd.append("--include-archived")
|
||||
if args.target:
|
||||
|
||||
@@ -2064,6 +2064,11 @@ def main():
|
||||
help="Show emulator ground truth details",
|
||||
)
|
||||
parser.add_argument("--json", action="store_true", help="JSON output")
|
||||
parser.add_argument(
|
||||
"--strict",
|
||||
action="store_true",
|
||||
help="Exit 1 when a platform that checks hashes misses a required file",
|
||||
)
|
||||
args = parser.parse_args()
|
||||
if args.platform:
|
||||
require_platform(args.platform, args.platforms_dir)
|
||||
@@ -2190,12 +2195,33 @@ def main():
|
||||
for result, group in group_results:
|
||||
print_platform_result(result, group, verbose=args.verbose)
|
||||
print()
|
||||
if len(group_results) > 1:
|
||||
print(_overall_summary(group_results))
|
||||
|
||||
if args.json:
|
||||
for r in all_results.values():
|
||||
r["details"] = [d for d in r["details"] if d["status"] != Status.OK]
|
||||
print(json.dumps(all_results, indent=2))
|
||||
|
||||
critical = sum(r["severity_counts"].get(Severity.CRITICAL, 0) for r, _ in group_results)
|
||||
if args.strict and critical:
|
||||
print(f"ERROR: {critical} required file(s) missing where the frontend "
|
||||
"checks hashes", file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
|
||||
def _overall_summary(group_results: list[tuple[dict, list[str]]]) -> str:
|
||||
"""One closing line for a multi-platform run, worst severity first."""
|
||||
platforms = sum(len(group) for _, group in group_results)
|
||||
totals = {
|
||||
sev: sum(r["severity_counts"].get(sev, 0) for r, _ in group_results)
|
||||
for sev in (Severity.CRITICAL, Severity.WARNING, Severity.INFO)
|
||||
}
|
||||
return (
|
||||
f"{platforms} platforms: {totals[Severity.CRITICAL]} critical, "
|
||||
f"{totals[Severity.WARNING]} warning, {totals[Severity.INFO]} info"
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in new issue
Block a user