Skip to content

Add e2e coverage for the backup API: no end-to-end spec exercises backup, restore, or status #1065

Description

@nanaf6203-bit

Add e2e coverage for the backup API: no end-to-end spec exercises backup, restore, or status

Labels / Complexity: testing · Medium Complexity — Medium

Problem

The test/e2e/ suite has no spec for the backup API. The backup/restore/status endpoints manage database snapshots — the data-loss boundary — and only unit specs cover fragments of the service (#86). With #42 (ephemeral archives) pending, there is no HTTP-level guard on backup behavior.

Why this is architecturally hard

  1. Restore is destructive. An e2e restore test must restore into an isolated test database (the test/database harness) so it cannot touch real data.
  2. Scheduling makes e2e tricky. Tests should drive the API (create backup, list, status) rather than waiting on cron; the schedule itself stays unit-covered.

Acceptance criteria

  • An e2e spec drives backup creation, listing, status, and restore against the test database.
  • The spec runs in CI with the existing e2e harness without touching non-test data.

Out of scope

The durability fix (#42); unit coverage (#86).

Getting started

  • test/database/ — the isolated test DB harness
  • src/backup/backup.controller.ts — the endpoints

Commands: npm run test:e2e (or the repo's e2e script from package.json).

Good first files to read: test/database/prisma-test-helpers.ts, src/backup/backup.controller.ts.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions