Tests: the directory's background work #402

Closed
opened 2026-11-06 19:51:43 -08:00 by rays · 1 comment
Owner

Untested in ipx-directory: apple.rs's sync, run and get (64 lines, 40%): the weekly Apple Podcasts chart import (#252), its retry after a failure, and the categories check; metrics.rs's new and serve; 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:

  • against a local stand-in for Apple's chart and lookup API: a sync accepts shows as the apple-podcasts snapshot, refuses private and blocked ones, and logs Apple Podcasts synced with its counts
  • a failed sync retries in an hour and does not drop the last good snapshot
  • Apple's categories that are not ipx's are logged (Apple's podcast categories are not ipx's)
  • /metrics serves the directory's metrics (directory_feed_checks_total and the rest)
  • an admin dropping a server's snapshot removes its feeds unless another server lists them

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.

Untested in ipx-directory: apple.rs's `sync`, `run` and `get` (64 lines, 40%): the weekly Apple Podcasts chart import (#252), its retry after a failure, and the categories check; metrics.rs's `new` and `serve`; 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: - against a local stand-in for Apple's chart and lookup API: a sync accepts shows as the `apple-podcasts` snapshot, refuses private and blocked ones, and logs `Apple Podcasts synced` with its counts - a failed sync retries in an hour and does not drop the last good snapshot - Apple's categories that are not ipx's are logged (`Apple's podcast categories are not ipx's`) - /metrics serves the directory's metrics (`directory_feed_checks_total` and the rest) - an admin dropping a server's snapshot removes its feeds unless another server lists them 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.
rays added the enhancement label 2026-11-06 19:51:43 -08:00
Author
Owner

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).

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).
rays closed this issue 2026-11-06 20:32:35 -08:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rays/ipx#402