vps-health-api/__tests__
le king fu b87b3d7253
All checks were successful
CI / verification (pull_request) Successful in 31s
fix(agent): run the backup pull under busybox, catch an empty filter
The CI runs the tests in node:22-alpine, where 9 of the 12 cases failed:
no ssh on PATH, and busybox has neither `find -printf` nor
`date -d "... days"`. The newest dated directory is now found by a loop
over the glob, and the rotation cutoff by epoch arithmetic, which GNU
date and busybox both read. The tests add a fake ssh, and a fake flock
where the host has none.

The rotation_failed case failed the pass through a read-only directory,
which root ignores: it now uses a fake rm.

Review suggestions: the rsync argv must put --include=*/ before
--exclude=* (without it nothing crosses and the pass still says ok), and
a case runs the real rsync through the fake ssh when rsync is present.
A pass whose newest directory is not today's logs a warning.

Refs maximus/la-compagnie-maximus#220

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-10 18:56:05 -04:00
..
fixtures/claude-usage feat(agent): add the claude-usage agent: plan limits, local cache, push 2026-10-04 15:26:15 -04:00
agent-claude-usage.test.js feat(agent): one-shot backfill of the Claude usage history from local transcripts 2026-10-08 20:44:45 -04:00
agent-pg-backup-pull.test.js fix(agent): run the backup pull under busybox, catch an empty filter 2026-10-10 18:56:05 -04:00
agent.test.js feat(agent): push workstation metrics to /hosts/<id> from cron 2026-08-16 12:21:59 -04:00
auth.test.js feat(server): archive closed Claude usage days by month, serve them on /claude-usage/history 2026-10-08 20:41:30 -04:00
ci.test.js feat(server): archive closed Claude usage days by month, serve them on /claude-usage/history 2026-10-08 20:41:30 -04:00
claude-usage-history.test.js fix(server): archive by latest date, never a day past reception 2026-10-08 21:34:54 -04:00
claude-usage.test.js feat(server): archive closed Claude usage days by month, serve them on /claude-usage/history 2026-10-08 20:41:30 -04:00
findings.test.js feat(defenseurs): add GET /defenseurs/findings?project=X route 2026-05-12 20:56:56 -04:00
health.test.js refactor: extract CPU/RAM/disk collection into metrics.js 2026-08-16 11:30:03 -04:00
hosts.test.js fix(server): require a full ISO receivedAt on read, cover the temp-file cleanup 2026-10-07 20:25:26 -04:00
state.test.js feat(defenseurs): serve the Sergent's findings state at GET /defenseurs/state 2026-09-24 20:42:20 -04:00
writes.test.js feat(server): archive closed Claude usage days by month, serve them on /claude-usage/history 2026-10-08 20:41:30 -04:00