Adds test/cli/backup-end-to-end.test.ts, which runs quak backup the way cron does: backupCommand through run, the real loadSession reading a session file that saveSession wrote after logging in, the retry options of quak backup with the waits stubbed, and every request answered by a fake of the Ente HTTP API serving data encrypted with libsodium. Nothing of quak's own code is replaced.
It covers each case of #186: the backup tree for an account with two albums of its own and one shared with it (a JPEG with EXIF in both, a video, a live photo), a second run that downloads nothing, a download that succeeds after two 503s, a 404 recorded in failures.json with exit 1, a refresh answered 401 with exit 3 that writes nothing but its lock, and --verify putting back an original changed on disk. No case showed a defect, so nothing was left out.
buildMetaFetch, its state type and the two encryption helpers moved from test/cli/metadata-backup.test.ts into test/ente-server.ts as they were, so both tests use them. The account setup at the top of buildMetaMock moved there too, as buildAccount(password), with its lines unchanged; buildMetaMock now calls it.
Deviation: no failing-tests-first commit, since the issue adds tests for behaviour that already exists.
Judgement call: the README's API reference names the new test beside test/cli/backup.test.ts.
Model: opus-5-5
Adds `test/cli/backup-end-to-end.test.ts`, which runs `quak backup` the way cron does: `backupCommand` through `run`, the real `loadSession` reading a session file that `saveSession` wrote after logging in, the retry options of `quak backup` with the waits stubbed, and every request answered by a fake of the Ente HTTP API serving data encrypted with libsodium. Nothing of quak's own code is replaced.
It covers each case of https://git.eeqj.de/sneak/quak/issues/186: the backup tree for an account with two albums of its own and one shared with it (a JPEG with EXIF in both, a video, a live photo), a second run that downloads nothing, a download that succeeds after two 503s, a 404 recorded in `failures.json` with exit 1, a refresh answered 401 with exit 3 that writes nothing but its lock, and `--verify` putting back an original changed on disk. No case showed a defect, so nothing was left out.
`buildMetaFetch`, its state type and the two encryption helpers moved from `test/cli/metadata-backup.test.ts` into `test/ente-server.ts` as they were, so both tests use them. The account setup at the top of `buildMetaMock` moved there too, as `buildAccount(password)`, with its lines unchanged; `buildMetaMock` now calls it.
- Deviation: no failing-tests-first commit, since the issue adds tests for behaviour that already exists.
- Judgement call: the README's API reference names the new test beside `test/cli/backup.test.ts`.
Model: opus-5-5
test/cli/backup-end-to-end.test.ts runs backupCommand through run, as
bin/quak.ts does, with the real loadSession reading a session saved after
logging in, and every request answered by a fake of the Ente HTTP API serving
data encrypted with libsodium. It covers the backup tree of an account with
two albums of its own and one shared with it, a second run that downloads
nothing, a download that succeeds after two 503s, a 404 recorded in
failures.json with exit 1, a refresh answered 401 with exit 3, and --verify
putting back an original changed on disk.
The fake server and the account it logs in moved from the backup-metadata
test into test/ente-server.ts, unchanged, so both tests use them.
Model: opus-5-5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Adds
test/cli/backup-end-to-end.test.ts, which runsquak backupthe way cron does:backupCommandthroughrun, the realloadSessionreading a session file thatsaveSessionwrote after logging in, the retry options ofquak backupwith the waits stubbed, and every request answered by a fake of the Ente HTTP API serving data encrypted with libsodium. Nothing of quak's own code is replaced.It covers each case of #186: the backup tree for an account with two albums of its own and one shared with it (a JPEG with EXIF in both, a video, a live photo), a second run that downloads nothing, a download that succeeds after two 503s, a 404 recorded in
failures.jsonwith exit 1, a refresh answered 401 with exit 3 that writes nothing but its lock, and--verifyputting back an original changed on disk. No case showed a defect, so nothing was left out.buildMetaFetch, its state type and the two encryption helpers moved fromtest/cli/metadata-backup.test.tsintotest/ente-server.tsas they were, so both tests use them. The account setup at the top ofbuildMetaMockmoved there too, asbuildAccount(password), with its lines unchanged;buildMetaMocknow calls it.test/cli/backup.test.ts.Model: opus-5-5
Review passed.
Model: opus-5-5
1f7171ef58to2322ba3dde