Commit Graph
8 Commits
Author SHA1 Message Date
Tobias KaupatandClaude Sonnet 5.5 421006e90b test: copy the structure config into the tool container instead of bind mounting
Works with a remote DOCKER_HOST as well.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 10:39:18 +02:00
Tobias KaupatandClaude Sonnet 5.5 e4016ef8fe test: print only the comment header for run.sh --help
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 10:39:03 +02:00
Tobias KaupatandClaude Sonnet 5.5 8607aa441c test: describe the structure suite fallback in the run.sh header
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 10:38:56 +02:00
Tobias KaupatandClaude Sonnet 5.5 c49d1810ca test: sabotage self test must fail the backup assertions by name
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 10:38:48 +02:00
Tobias KaupatandClaude Sonnet 5.5 abe01179de test: avoid GNU-only sed -i in the sabotage self test
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 10:38:48 +02:00
Tobias KaupatandClaude Sonnet 5.5 76975658a7 fix: reject --suite without a value instead of running all suites
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-18 10:16:59 +02:00
Tobias KaupatandClaude Opus 5 6cb2f72cf9 fix: make the test suites work on Windows/Git-Bash out of the box
MSYS rewrites POSIX-looking arguments before docker sees them, so
`docker exec <id> /usr/bin/backup` arrived as
`C:/Program Files/Git/usr/bin/backup` and the structure suite could not
read `--config /test/structure.yml`. 23 of 32 compat assertions and the
whole structure suite failed on Git-Bash, while test/lib.sh claimed the
suites behave identically on every platform.

test/lib.sh and test/run.sh now export MSYS_NO_PATHCONV=1 and
MSYS2_ARG_CONV_EXCL='*' themselves - lib.sh for the suites that source it,
run.sh for its own docker calls and the suites it starts as separate
processes. Both variables are ignored on Linux and macOS. README documents
that nothing has to be exported by hand.

Verified on Git-Bash without any variable set in the environment:
structure 13/13, compat 32/32, features 4 SKIP, exit 0, and
`bash test/run.sh --sabotage` still reports "sabotage check ok".

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

Agent-Id: agent-4966d0e6-7f4d-4b37-be3d-0648ed56cb8a
2026-10-17 23:27:02 +02:00
Tobias KaupatandClaude Opus 5 10b197f1f5 test: add container test suites and run them in CI
The repository had no tests: CI only built the image, and the old
container-structure-test setup was parked as config-broken.yml /
docker-compose.test.broken.yml. This adds suites that actually run the image.

- test/compat.sh: backup, restore, forget, check, hooks, failure handling and
  timezone behaviour against the default configuration. These describe what
  users depend on today, so a change that turns them red is a breaking change.
- test/features.sh: optional features, each guarded by a detection check
  against the built image. Absent features are reported as SKIP, so open pull
  requests do not turn master red, and their feature tests start running by
  themselves once the pull request is rebased. Covers #109 (RESTIC_STREAM),
  #99 (docker cli, bash) and #84 (msmtp).
- test/required-features.txt: once a feature is merged its gate is listed here
  and a missing feature becomes a failure instead of a skip.
- test/structure.yml: revived image layout checks, falls back to the official
  container-structure-test image when the tool is not installed.
- test/run.sh --sabotage: breaks the backup call on a throwaway copy of the
  tree and expects the suite to fail, so the tests cannot be watered down into
  always passing. CI runs this as its own step.
- .github/workflows/test.yml: shellcheck plus all suites on every pull request.

Also adds .gitattributes pinning shell scripts, the Dockerfile and YAML to LF.
With a Windows checkout (core.autocrlf=true) the scripts were checked out with
CRLF, and the resulting image failed to start with
"exec /entry.sh: no such file or directory".

No runtime file is touched, the image itself is unchanged.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

Agent-Id: agent-7034f75b-1ddc-4aa1-a4ea-3a54b340e8d9
2026-10-17 22:47:26 +02:00