diff options
| author | ItsNotRexed <300290919+ItsNotRexed@users.noreply.github.com> | 2026-11-22 23:15:27 -0500 |
|---|---|---|
| committer | ItsNotRexed <300290919+ItsNotRexed@users.noreply.github.com> | 2026-11-22 23:15:27 -0500 |
| commit | 09abd97dbb66cc4528e2e9344499dd0cdb282d76 (patch) | |
| tree | ed86c67fb6746b411c72e697e862d58056afd24f /tools/progress_dashboard.py | |
| parent | 9711e54c0cf8735a926ad1114cd26074f1d94049 (diff) | |
| parent | 9fc6b263e459526f6646855a0444d95ecf9bbe21 (diff) | |
Merge pull request #4515 from Silent
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tools/progress_dashboard.py')
| -rw-r--r-- | tools/progress_dashboard.py | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/tools/progress_dashboard.py b/tools/progress_dashboard.py index 3a9aac875..9c86f9ba4 100644 --- a/tools/progress_dashboard.py +++ b/tools/progress_dashboard.py | |||
| @@ -238,11 +238,17 @@ def last_commit_time(path): | |||
| 238 | 238 | ||
| 239 | 239 | ||
| 240 | # ----------------------------------------------------------------------------------------------- unit tests | 240 | # ----------------------------------------------------------------------------------------------- unit tests |
| 241 | def _walk_error(exc: OSError): | ||
| 242 | # os.walk skips a directory it cannot list unless onerror raises; the dashboard must not report an | ||
| 243 | # incomplete test selection or code digest as complete. main() turns the OSError into one error line. | ||
| 244 | raise exc | ||
| 245 | |||
| 246 | |||
| 241 | def ci_test_files(): | 247 | def ci_test_files(): |
| 242 | """tests/test_*.py that CI runs one by one: standard-library files with a __main__ block (ci.yml).""" | 248 | """tests/test_*.py that CI runs one by one: standard-library files with a __main__ block (ci.yml).""" |
| 243 | found = [] | 249 | found = [] |
| 244 | tests = os.path.join(ROOT, "tests") | 250 | tests = os.path.join(ROOT, "tests") |
| 245 | for base, dirs, files in os.walk(tests): | 251 | for base, dirs, files in os.walk(tests, onerror=_walk_error): |
| 246 | dirs[:] = sorted(d for d in dirs if d not in ("semantic", "__pycache__", "fixtures")) | 252 | dirs[:] = sorted(d for d in dirs if d not in ("semantic", "__pycache__", "fixtures")) |
| 247 | for name in sorted(files): | 253 | for name in sorted(files): |
| 248 | if not (name.startswith("test_") and name.endswith(".py")): | 254 | if not (name.startswith("test_") and name.endswith(".py")): |
| @@ -288,7 +294,7 @@ def code_digest(): | |||
| 288 | h = hashlib.sha256() | 294 | h = hashlib.sha256() |
| 289 | rels = ["make_game.py"] | 295 | rels = ["make_game.py"] |
| 290 | for d in CODE_DIRS: | 296 | for d in CODE_DIRS: |
| 291 | for base, dirs, files in os.walk(os.path.join(ROOT, d)): | 297 | for base, dirs, files in os.walk(os.path.join(ROOT, d), onerror=_walk_error): |
| 292 | dirs[:] = sorted(x for x in dirs if x not in ("__pycache__", "bin", "obj", "target", "build") and not x.startswith(".")) | 298 | dirs[:] = sorted(x for x in dirs if x not in ("__pycache__", "bin", "obj", "target", "build") and not x.startswith(".")) |
| 293 | rels += [os.path.relpath(os.path.join(base, f), ROOT).replace("\\", "/") for f in sorted(files) if f.endswith(".py")] | 299 | rels += [os.path.relpath(os.path.join(base, f), ROOT).replace("\\", "/") for f in sorted(files) if f.endswith(".py")] |
| 294 | for rel in rels: | 300 | for rel in rels: |
| @@ -1016,7 +1022,11 @@ def main(argv=None): | |||
| 1016 | if args.tests and not args.test_files: | 1022 | if args.tests and not args.test_files: |
| 1017 | ap.error("--tests did not match any test files") | 1023 | ap.error("--tests did not match any test files") |
| 1018 | os.makedirs(out_dir, exist_ok=True) | 1024 | os.makedirs(out_dir, exist_ok=True) |
| 1019 | snap = build(args, out_dir) | 1025 | try: |
| 1026 | snap = build(args, out_dir) | ||
| 1027 | except OSError as exc: | ||
| 1028 | print(f"error: {exc.filename or ''}: {exc.strerror or exc}", file=sys.stderr) | ||
| 1029 | return 2 | ||
| 1020 | new = write_outputs(snap, out_dir) | 1030 | new = write_outputs(snap, out_dir) |
| 1021 | n = len(snap["components"]) | 1031 | n = len(snap["components"]) |
| 1022 | print(f"{n} units, {len(snap['metrics'])} metrics -> {os.path.join(out_dir, 'progress.html')}" | 1032 | print(f"{n} units, {len(snap['metrics'])} metrics -> {os.path.join(out_dir, 'progress.html')}" |