forked from mtusi2026/mtusi2026lab3
43 lines
1.6 KiB
Python
43 lines
1.6 KiB
Python
"""Полная проверка перед сдачей; инфраструктурные этапы строго последовательно."""
|
|
|
|
import argparse
|
|
import json
|
|
import subprocess
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
ROOT = Path(__file__).resolve().parents[1]
|
|
parser = argparse.ArgumentParser(description=__doc__)
|
|
parser.add_argument(
|
|
"--research", action="store_true", help="Повторить 18 измерений и построить графики"
|
|
)
|
|
args = parser.parse_args()
|
|
steps = [
|
|
("audit-run", "scripts/audit-lab3.py"),
|
|
("edge-audit", "scripts/edge-audit-lab3.py"),
|
|
("verify", "scripts/verify-lab3.py"),
|
|
("final-checks", "scripts/final-checks-lab3.py"),
|
|
("clean-start", "scripts/test-clean-lab3.py"),
|
|
]
|
|
if args.research:
|
|
steps += [
|
|
("research-run", "scripts/research-lab3.py"),
|
|
("research-plots", "scripts/plot-lab3.py"),
|
|
]
|
|
summary = {}
|
|
for name, script in steps:
|
|
print("Starting " + name, flush=True)
|
|
with (ROOT / "evidence" / ("lab3-" + name + ".txt")).open("w") as output:
|
|
result = subprocess.run(
|
|
[sys.executable, script] + (["--full"] if name == "research-run" else []),
|
|
cwd=ROOT,
|
|
stdout=output,
|
|
stderr=subprocess.STDOUT,
|
|
)
|
|
summary[name] = "PASS" if result.returncode == 0 else "FAIL"
|
|
(ROOT / "evidence/lab3-review-summary.json").write_text(json.dumps(summary, indent=2) + "\n")
|
|
print(name + " " + summary[name], flush=True)
|
|
if result.returncode:
|
|
raise SystemExit(result.returncode)
|
|
print("PASS: complete pre-submission review", flush=True)
|