Tests: Signals' judging, pacing and icons #398
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
signals.rs is at 45% of its lines:
pass(70 lines),ask,judge,pace,back_off,check_key,pick_iconandcallednever run, and in web.rs the Signal handlers (add_signal,patch_signal,remove_signal,pick_signal_icon,signal_description,signal_entries) are untested; on the page, signals.ts is at 32% (renderSignals,signalAction,keySetting,signalHead,feedRow). The browser Signals tests skip themselves unless the Signals code changed (#271), so a coverage run does not reach them either; the fixture server's /jev stands in for TypeSafe, so they need not spend a key.Tests to add:
rate_limited) and the next call waits for its turn (paced_ms); a refused key stops that person's judging (key_refused) without stopping others'; a malformed request is counted (#257)ipx_jev_tokens_total{key}, #278)Seen with the coverage of both suites merged line by line (cargo:
sh scripts/coverage.sh, browser:sh scripts/coverage.sh api; reports in target/coverage/cargo, api and page; #390, #394), as of 2026-11-07. A test added here shows in Grafana's Coverage row at the next run.Tests added in
980fbc3. cargo, against a stand-in for Jev (signals.rs tests::jev, answering by key): a pass judges each item once, keeps verdicts and bills the owner's key (ipx_jev_tokens_total's source, STATS.billed); a refused key stops only its owner and is not sent again (key_refused); a 429 stops the pass and the next call waits out Retry-After (rate_limited, paced); a 422 stops the pass (malformed, #257); check_key and pick_icon, the latter refusing an icon it was not offered. web.rs: make, validate, rename, re-word, clear the icon, list entries, delete, and another person's Signal 404. Browser: rename and delete from the Signal's page. scripts/coverage.sh sets IPX_SIGNALS_TESTS=1. Not done: the server-key judging path in cargo (server_key reads TYPESAFE_KEY from the environment, which the browser test 'the server pays for Signals' covers), and POST /api/signals/icon, which needs TYPESAFE_KEY too.