mirror of
https://github.com/lobaro/restic-backup-docker.git
synced 2026-11-20 00:55:19 +00:00
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
This commit is contained in:
1 parent
9f1c80951d
commit
6cb2f72cf9
3 files changed
+23
No files matched your search
@@ -37,6 +37,12 @@ bash test/run.sh --no-build # reuse an already built image
|
||||
bash test/run.sh --suite compat # run a single suite
|
||||
```
|
||||
|
||||
They run unchanged on Linux, macOS and Windows/Git-Bash. On Git-Bash the
|
||||
scripts set `MSYS_NO_PATHCONV=1` and `MSYS2_ARG_CONV_EXCL='*'` themselves,
|
||||
because MSYS would otherwise rewrite container paths such as
|
||||
`/usr/bin/backup` into `C:/Program Files/Git/usr/bin/backup` before `docker`
|
||||
sees them. Nothing has to be exported by hand.
|
||||
|
||||
There are three suites:
|
||||
|
||||
* **compat** (`test/compat.sh`) - backup, restore, forget, check, hooks and
|
||||
|
||||
Reference in new issue
Block a user