diff options
| author | hathach <[email protected]> | 2026-06-08 16:18:04 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2026-06-08 16:18:04 +0700 |
| commit | 7b60e3951e800bcdc5e1e015ca078d4f3cd6080e (patch) | |
| tree | 6f9281a5b9317461ca95b76d85ed73b17b663d16 | |
| parent | fba8d257846ab9149f9db5443827d741492f837d (diff) | |
test/hil: clear HIL report up front on a fresh run
The report sidecar lives in a persistent dir (it survives the CI workspace
clean so accumulation works across run attempts). A full run is "fresh" and
must not merge prior state, but previously fresh only avoided *loading* the
json at merge time — if a fresh run crashed before writing the report, the
stale json/md from an earlier run lingered and a retry (fresh=False) could
merge it, or the always() upload could post it. Delete hil_report.json/.md at
the start of a fresh run so prior results can never leak.
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
| -rwxr-xr-x | test/hil/hil_test.py | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/test/hil/hil_test.py b/test/hil/hil_test.py index 515c20e75..542aa4a11 100755 --- a/test/hil/hil_test.py +++ b/test/hil/hil_test.py @@ -1828,6 +1828,17 @@ def main() -> None: print(f'Build phase done: {build_err} failed') print('-' * 30) + # HIL report sidecar (hil_report.json/.md). A full run starts fresh; a re-run + # (--skip-board / -bt, i.e. the .skip file) accumulates so already-passed + # boards/tests are preserved. Clear any prior report up front on a fresh run so + # a crash mid-run can't leave stale results to be merged by a retry or posted. + report_dir = Path(os.environ.get('HIL_REPORT_DIR', '.')) + fresh = not (args.skip_board or args.board_test) + if fresh: + report_dir.mkdir(parents=True, exist_ok=True) + for f in (REPORT_JSON, REPORT_MD): + (report_dir / f).unlink(missing_ok=True) + with Pool(processes=os.cpu_count() or 1, initializer=init_worker, initargs=(Lock(),)) as pool: async_ret = pool.map_async(test_board, config_boards) try: @@ -1850,11 +1861,7 @@ def main() -> None: elif skip_fname.exists(): skip_fname.unlink() - # board x test result matrix -> hil_report.md (accumulates across re-runs) + stdout. - # A full run starts fresh; a re-run (--skip-board / -bt, i.e. the .skip file) merges - # into the existing report so already-passed boards/tests are preserved. - report_dir = Path(os.environ.get('HIL_REPORT_DIR', '.')) - fresh = not (args.skip_board or args.board_test) + # board x test result matrix -> hil_report.md (accumulates across re-runs) + stdout report = accumulate_report(mret, report_dir, fresh) print() print(report) |
