Skip to content

End-to-end tests against real SnapRAID, snapraid-daemon and the Docker image - #26

Merged
firsttris merged 4 commits into
masterfrom
claude/trusting-tesla-543ryb
Oct 9, 2026
Merged

firsttris merged 4 commits into
masterfrom
claude/trusting-tesla-543ryb

Conversation

@firsttris

@firsttris firsttris commented Oct 9, 2026 •

Copy link
Copy Markdown
Owner

What

End-to-end tests (e2e/, Playwright with Chromium): the UI is driven through the browser against real SnapRAID and snapraid-daemon on throwaway arrays.

Test Covers
array.spec.ts Dashboard health and disks; sync with preview (new and deleted files); bit rot found by a full scrub and repaired byte for byte by Repair (fix -e); Undelete
schedules.spec.ts Nightly routine (touch → sync → scrub) created in the form and started with Run now; scheduled sync skipped while a disk is not mounted, dashboard shows Disk not available
notifications.spec.ts Webhook set up in the UI: the test message and job failed reach a local receiver
config.spec.ts Data disk added in the visual editor is protected by the next sync
docker.spec.ts Container is paused during the sync and resumed after it (docker events)
daemon.spec.ts Daemon mode switched on in the UI, Test connection, then the sync runs as a snapraid-daemon task
  • npm run setup builds the pinned versions into e2e/.tools: SnapRAID 14.10 (the image's version), SnapRAID 15, and snapraid-daemon at REVIEWED_DAEMON_VERSION.
  • The global setup starts the daemon, the backend, the production frontend build, and a small proxy that routes /api and /ws the way nginx does.
  • E2E_IMAGE=<image> runs the same 10 tests against the Docker image, started as in docker-compose.yml (data in /app/snapraid, disks at the same paths as on the host, Docker socket mounted).
    • The container writes as root, so in this mode the tests check files with docker exec inside the container.
    • At the end the container hands the test data back to the caller, so runners without root can read and delete it.
  • CI: a new e2e matrix job with local and image. The image job builds the image from docker/Dockerfile. Tool builds are cached, and on failure traces and server logs are uploaded.

Run now: a play button on each schedule runs it once immediately: same steps, sync guard, disk checks, Docker pause and notifications. It also works on disabled schedules. Backend: POST /api/schedules/:id/run, returning 202, 404 if the schedule doesn't exist, 409 if a job is running.

Bug found by the E2E test: adding a data disk with a trailing slash in its path produced content /mnt/disk1//.snapraid.content. SnapRAID only excludes its content files when the path matches as written. So this file was synced as a data file, and every diff showed it as changed. Now uses join(), with a unit test.

Other changes

  • The backend reads PORT (default 8080, as in the image's supervisord).
  • e2e/ is added to .dockerignore.
  • Docs: new End-to-end tests section in docs/development.md, Run now in docs/scheduling.md. The upstream release checklists also name e2e/scripts/setup-tools.sh.

Verified

  • Backend: deno check, deno test (122 passed).
  • Frontend: Biome, typecheck, Vitest (24).
  • mkdocs build --strict.
  • E2E local: 10/10, three runs in a row, about 1.3 min including the frontend build.
  • E2E against the image: 10/10.
    • In CI (e2e (image)), with the image built from docker/Dockerfile.
    • Locally as a non-root user, the same setup as the GitHub runner.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JuXnquCPdbG5sBbDyin7yF

claude added 4 commits October 9, 2026 08:03
A play button on each schedule starts it once, right away, as at its time:
the same steps, sync guard, disk checks, Docker pause and notifications.
Also for disabled schedules, to try a routine before enabling it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JuXnquCPdbG5sBbDyin7yF
A mount path with a trailing slash gave /mnt/disk1//.snapraid.content.
SnapRAID excludes its content files by comparing the path as written, so
the file was synced like a data file and every diff showed it as changed.
Found by the end-to-end test of the config editor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JuXnquCPdbG5sBbDyin7yF
…r image

e2e/ drives the UI with Playwright against SnapRAID 14.10, SnapRAID 15
and snapraid-daemon on throwaway arrays: sync with preview, bit rot found
by scrub and repaired by fix -e, undelete, the nightly routine, a sync
skipped for an unmounted disk, webhook notifications, the config editor,
Docker pause and the daemon mode. E2E_IMAGE runs the same tests against
the Docker image. CI runs both, the backend reads PORT for the tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JuXnquCPdbG5sBbDyin7yF
…ests

The container writes as root and SnapRAID creates content and restored
files readable only by their owner, so a test runner without root (CI)
could not read them. In image mode the checks run with docker exec, and
the container hands the test data back to the caller at the end.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JuXnquCPdbG5sBbDyin7yF
@firsttris
firsttris merged commit d681b5b into master Oct 9, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants