Tests: the directory's background work #402
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?
Untested in ipx-directory: apple.rs's
sync,runandget(64 lines, 40%): the weekly Apple Podcasts chart import (#252), its retry after a failure, and the categories check; metrics.rs'snewandserve; and dropping a server's snapshot (drop_instance, in ipx's directory.rs and the directory's API). The weekly sync runs unattended; if it breaks, the directory quietly stops taking Apple's shows.Tests to add:
apple-podcastssnapshot, refuses private and blocked ones, and logsApple Podcasts syncedwith its countsApple's podcast categories are not ipx's)directory_feed_checks_totaland the rest)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
8e8307b. apple.rs: sync against a local stand-in for Apple (base address now an argument; no pause under test): charts deduplicated in order, looked up, filed as apple-podcasts with a private feed refused, a blocked one left out of the next sync, and a failed lookup leaving the last good snapshot. metrics.rs: serve answers /metrics with every directory_ name grafana/dashboard.py and alerts.py query. api.rs: dropping a snapshot is admin-only and removes only the feeds no other server lists. Not done: the hour's wait after a failed sync in run() (the loop's sleep), and the categories-differ warning as a log line (differ itself was already tested).