Discarded-check unit tests check nothing was recorded #173

Merged
clawbot merged 1 commits from issue-151-discarded-check-records-nothing into next 2026-10-19 03:44:14 +02:00
Collaborator

The three unit tests of a check whose result is discarded (its round given up, the user paused, or the first round) checked only that the host's row showed nothing. The guard in tick also keeps the result out of the host's history and status and keeps logCheck from writing to the console, so a change that recorded the result and skipped only the row kept all three passing. Each test now also checks that the answering host's history is still empty, its status still pending, and that nothing went to console.error or console.info. Moving the guard to just before the row update, as #151 describes, makes all three fail; web/src/main.js is unchanged.

Things the diff does not make obvious:

  • Judgement call: the three test names now say "is not recorded and does not show in its row", and the comment above them says the same, since the tests now check more than the row.
  • Judgement call: the consoleLines helper moved up to the other helpers at the top of the file, as these tests now use it before its old place.
  • status is compared with pending and history with an empty list, as each test's host is new and that is how it starts.

Model: opus-5-5

The three unit tests of a check whose result is discarded (its round given up, the user paused, or the first round) checked only that the host's row showed nothing. The guard in `tick` also keeps the result out of the host's history and status and keeps `logCheck` from writing to the console, so a change that recorded the result and skipped only the row kept all three passing. Each test now also checks that the answering host's `history` is still empty, its `status` still `pending`, and that nothing went to `console.error` or `console.info`. Moving the guard to just before the row update, as https://git.eeqj.de/sneak/netwatch/issues/151 describes, makes all three fail; `web/src/main.js` is unchanged. Things the diff does not make obvious: - Judgement call: the three test names now say "is not recorded and does not show in its row", and the comment above them says the same, since the tests now check more than the row. - Judgement call: the `consoleLines` helper moved up to the other helpers at the top of the file, as these tests now use it before its old place. - `status` is compared with `pending` and `history` with an empty list, as each test's host is new and that is how it starts. Model: opus-5-5
clawbot added the needs-review label 2026-10-19 03:34:32 +02:00
clawbot self-assigned this 2026-10-19 03:34:33 +02:00
clawbot added 1 commit 2026-10-19 03:34:33 +02:00
The three unit tests of a check whose result is discarded (its round
given up, the user paused, or the first round) checked only that the
row showed nothing. Each now also checks that the host's history is
still empty, its status still pending, and nothing was written to the
console, so a change that recorded the result and skipped only the row
fails them. The console helper moves above its first use.

Model: opus-5-5
Author
Collaborator

Review passed.

Model: opus-5-5

Review passed. Model: opus-5-5
clawbot merged commit 648c225919 into next 2026-10-19 03:44:14 +02:00
clawbot deleted branch issue-151-discarded-check-records-nothing 2026-10-19 03:44:14 +02:00
clawbot removed the needs-review label 2026-10-19 03:44:15 +02:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/netwatch#173