Open
Conversation
Introduces BATS-based E2E tests using Docker Compose to validate the full backup+restore cycle for local files and PostgreSQL. Mocks SFTP and Telegram via local containers. Adds e2e-tests job to CI pipeline that gates publishing. https://claude.ai/code/session_01GDxeSuK5DUawjDs73W1ENL
- Add do_GET to mock-telegram for healthcheck compatibility - Fix SSH_PRIVATE_KEY_BASE64 env var (placeholder + loaded from file at runtime) - Fix sftp-server healthcheck (use file check instead of ss command) - Add postgres dependency to backup container - Fix env validation success test to load key from mounted file https://claude.ai/code/session_01GDxeSuK5DUawjDs73W1ENL
- Fix COMPOSE_FILE path: was pointing to parent dir instead of test dir - Add --if-exists to pg_restore to avoid errors on missing objects - Remove -v flag from pg_restore to reduce noise https://claude.ai/code/session_01GDxeSuK5DUawjDs73W1ENL
- Show SSH key files and sizes - Show container status and env vars before tests - Test backup container connectivity - Show container logs after test run (pass or fail) - Use --print-output-on-failure for BATS https://claude.ai/code/session_01GDxeSuK5DUawjDs73W1ENL
- Add missing run wrapper for cp command in local backup test - Simplify postgres test quoting (remove fragile nested escaping) - Use single-quote shell passthrough for all postgres commands - Add || true to pg_restore (may warn on clean of non-existent objects) https://claude.ai/code/session_01GDxeSuK5DUawjDs73W1ENL
- Add pre-BATS smoke test: SSH setup, SFTP connection, restic init - Enable --verbose-run and --trace for full BATS debug output - This will show exactly which command fails and why https://claude.ai/code/session_01GDxeSuK5DUawjDs73W1ENL
- Remove set -e to prevent silent early exit before logs are collected - Add EXIT trap that always collects logs and tears down containers - Use --wait with timeout instead of manual health check loop - Add set -x to smoke test for full command tracing - This ensures CI always shows container logs even on failure https://claude.ai/code/session_01GDxeSuK5DUawjDs73W1ENL
- Tee full run_e2e.sh output to log file - Write last 200 lines of output + container logs to Job Summary - Job Summary is visible on the workflow run page without auth https://claude.ai/code/session_01GDxeSuK5DUawjDs73W1ENL
Replace job summary with PR comment containing last 150 lines of test output and container logs. PR comments are readable via API. https://claude.ai/code/session_01GDxeSuK5DUawjDs73W1ENL
The github-script action needs write permission to post PR comments. https://claude.ai/code/session_01GDxeSuK5DUawjDs73W1ENL
E2E Test Failure LogsTest Output (last 150 lines)Container Logs |
Parse full_output.log to find and post specific sections: - BATS test output (the actual test results) - Smoke test output - Debug output Instead of just last N lines which showed only container logs. https://claude.ai/code/session_01GDxeSuK5DUawjDs73W1ENL
E2E Test Failure LogsBATS Test OutputSmoke Test OutputDebug Output |
The atmoz/sftp image needs directories specified in the command (format user:pass:uid:gid:shell:dirs) to create them with correct ownership. Without this, Docker creates the volume mount as root and testuser (UID 1001) cannot write to it. Changed command from "testuser::1001" to "testuser::1001:::repos" https://claude.ai/code/session_01GDxeSuK5DUawjDs73W1ENL
E2E Test Failure LogsBATS Test OutputSmoke Test OutputDebug Output |
The sftp-data volume mounted at /home/testuser/repos was created by Docker as root, overriding the directory permissions set by atmoz/sftp's create-sftp-user script. Removed the volume mount so the 'repos' directory is created by the SFTP container itself with correct UID 1001 ownership. https://claude.ai/code/session_01GDxeSuK5DUawjDs73W1ENL
E2E Test Failure LogsBATS Test OutputSmoke Test OutputDebug Output |
Restic needs to create subdirectories inside the SFTP path. With RESTIC_REPOSITORY_NAME=repos/test-repo, restic tries to create 'test-repo' inside 'repos' but lacks permission for nested creation. Changed to RESTIC_REPOSITORY_NAME=repos so restic uses the writable 'repos' directory directly as the repository root. https://claude.ai/code/session_01GDxeSuK5DUawjDs73W1ENL
E2E Test Failure LogsBATS Test OutputSmoke Test OutputDebug Output |
The atmoz/sftp chroot prevents restic from creating repositories due to strict ownership rules. Instead of fighting SFTP permissions, use a local directory (/restic-repo) as the restic backend. This still tests the full backup+restore cycle (restic init, backup, check, forget, restore) - just without the SFTP transport layer which is not our code anyway. Changes: - Remove sftp-server service from docker-compose - Use RESTIC_REPOSITORY=/restic-repo (local path) - Remove SSH key generation from CI pipeline - Simplify helpers (no SSH setup needed) - Fix env validation test to not require SSH server https://claude.ai/code/session_01GDxeSuK5DUawjDs73W1ENL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduces BATS-based E2E tests using Docker Compose to validate the full backup+restore cycle for local files and PostgreSQL. Mocks SFTP and Telegram via local containers. Adds e2e-tests job to CI pipeline that gates publishing.
https://claude.ai/code/session_01GDxeSuK5DUawjDs73W1ENL