Repository navigation
Keep the test report on the panel until it is explicitly cleared - #38
Open
the-real-orca wants to merge 2 commits into
Open
the-real-orca wants to merge 2 commits into
the-real-orca wants to merge 2 commits into
Conversation
`end` discarded the session, so the panel showed "No test session active" the moment a suite exited. The pass/fail list the operator had been watching was gone with no way back, and the report is most useful exactly when the run is over. `end` now marks the session `ended` and records `ended_at`; a later update re-opens it. DELETE /api/test/progress discards it, refused with 400 while a session is still running, so a live run cannot be wiped by a stray click. The panel gains a Clear button, enabled only once the session has ended. bench_reset() still nulls the session outright, which stays right: that is the start of a run. Driver: test_progress() and test_clear(). FSD: FR-019 gains the endpoint, the persistence rule and the session-state field table. New test test_test_report_survives_its_own_end, which skips rather than clobbers when a session is in progress. test_end() on a bench with no session now answers 400 instead of ok:true. The only caller in the suite already wraps it, but it is a contract change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Of the four panels on the page the log was the only one whose heading sat *inside* the box, in grey 1.1em instead of the cyan centred h2 the signal generator, the SDR console and the test panel all use. Nothing needed it that way — it was simply never aligned. The heading moves out of the box, which needs a box to move out of: the styling goes to a new .log-box and .log-section keeps only the flex column, so the chain section -> box -> entries is intact and the log still takes whatever height is left on the page. The h2 override shrinks to the one declaration that is about layout rather than looks. Cosmetic only. No endpoint, no behaviour, no FSD clause touched.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Keep the test report on the panel until it is explicitly cleared
Base:
SensorsIot/Embedded-AI-Harnessmain(b7bc87e) · Head:feat/test-clearDiff: 6 files, +177 / −11 · extends FR-019
Commits: the feature (+163 / −7) and one cosmetic follow-up that aligns the activity log panel with the rest of the page (+14 / −4) — separable, drop it if you'd rather not carry it.
Why
POST /api/test/update {"end": true}discards the session outright. The operator turns to the panel after a suite exits and finds "No test session active" — the pass/fail list is gone, with no way to get it back. The report is most useful exactly when the run is over.What changed
The session now survives its own end and is discarded on request instead.
endmarks rather than deletes — setsended: trueandended_at; the session also gainsstarted_at. Any later update re-opens it.DELETE /api/test/progressclears the report. Refused with 400 while a session is still running, so a live run cannot be wiped by a stray click.Clearbutton at the bottom left of the Test Progress panel, enabled only once the session has ended, plus a banner saying the report is being held. Heading and button follow the shape every other panel on the page already uses: centredh2above the box, actions bottom left, and one shared rule for the button so it cannot drift from the log'sClear.test_progress()andtest_clear().test_test_report_survives_its_own_endinTestApiSurface(104 → 105). It skips if a session is in progress rather than clobbering it.bench_reset()still nulls the session unconditionally, which stays correct: that is the start of a run, where discarding is the point.Contract change
test_end()on a bench with no session now returns400 {"ok": false, "error": "no active session"}instead of{"ok": true}. The only caller in the suite,_end_test_session, already wraps it intry/except, so nothing breaks.Verification
ruff checkclean ·py_compileOK · 105 tests collected ·pytest/host22 passed · all touched files LF.Verified on hardware, 2026-09-09. Bench
esp32-workbench: Raspberry Pi 3 Model B Rev 1.2, Debian 13 trixie, Python 3.13.5, this branch installed from a fresh SD image viapi/install.sh.