| name | koha-prove |
| description | Run Koha Perl tests inside the KTD container. Pass a test file or directory path (relative to the Koha repo root, or absolute). Handles both t/ and t/db_dependent/ automatically. |
Run the specified Koha test(s) in KTD.
Arguments: $ARGUMENTS
Steps:
- Normalize the path: strip any leading absolute path so the result is a
repo-relative path like
t/Koha/Foo.t or t/db_dependent/Circulation/.
Common prefixes to strip: any path ending in /koha/.
- Verify the container is running:
docker ps --filter name=${KTD_INSTANCE:-kohadev}-koha-1 --format '{{.Names}}'
If empty, report: "KTD container is not running. Start it with: ktd up" and stop.
- Run the test:
ktd --name "${KTD_INSTANCE:-kohadev}" --shell --run 'prove -v PATH'
where PATH is the normalized path.
- Report the full output including pass/fail summary and any test failures.
Notes:
- Never run
prove on the host — it lacks the Koha Perl environment and will fail.
prove -r t/db_dependent/ runs the full DB-dependent suite (slow); for quick iteration, target a single file or subdirectory.