Tests: the daemon's start, shutdown and the CLI talking to it #400
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?
daemon.rs is at 76% and cli.rs at 41% of their lines. Untested: a second daemon refused while one listens on the socket (line 57; CLAUDE.md, two daemons fighting over a database); the first start writing a web token and bind (
start_web, 247-259); a SIGTERM during a job abandoning it (173);until_stoppedanduntil_next_scan; and in the CLI,runand ipc.rs'sproxy(a command forwarded to a running daemon) andhuman(its output in words). These are what production's start andipx statusdepend on.Tests to add:
ipx status,ipx fetch <feed>,ipx listwith a daemon running go through the socket and print as before; without one,--localdoes the work itselfstart, #374) has its stepsSeen 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
2db42b5. crates/ipx/tests/daemon.rs runs the built binary as production does (scratch config, SQLite, a local feed whose episode trickles): ipx status through the socket and with --local; a first start writes a token, keeps it out of the log, and it signs in; a second daemon is refused with 'a daemon is already listening' and the first keeps serving; SIGTERM mid-download exits in under 5 s, logs the abandoned job, removes the socket and leaves the episode queued; a restart is clean; ipx status without a daemon works alone. daemon.rs: until_next_scan's 30 s floor and 10 minute ceiling. Found: the abandoned download is not taken again at the next start, only at its feed's next check (#410). Not done: the start trace's steps (needs a trace exporter to read them from), and ipx fetch through the socket, which waits for the whole scan and so for the slow episode.