diff --git a/wizard-work/spark/verify_report.py b/wizard-work/spark/verify_report.py index c670fb2..0b555f1 100644 --- a/wizard-work/spark/verify_report.py +++ b/wizard-work/spark/verify_report.py @@ -1,8 +1,15 @@ #!/usr/bin/env python3 import json + + +def _check(cond, msg="check failed"): + """Explicit failure path -- survives `python3 -O`, where `assert` is compiled away.""" + if not cond: + raise SystemExit(f"FAIL: {msg}") + report = json.load(open('/root/.hermes/wizard-outputs/spark/validation_report.json')) -assert report['summary']['valid_count'] == 1, "Expected 1 valid file" -assert report['summary']['invalid_count'] == 1, "Expected 1 invalid file" -assert report['test_passed'] == True, "Test should be marked as passed" +_check(report['summary']['valid_count'] == 1, "Expected 1 valid file") +_check(report['summary']['invalid_count'] == 1, "Expected 1 invalid file") +_check(report['test_passed'] == True, "Test should be marked as passed") print("All assertions passed") exit(0) \ No newline at end of file