Files
tbd/script/docker-unit-coverage
ajet aa3cfef2b3
CI / Unit tests (push) Successful in 27s
CI / Integration tests + coverage (push) Failing after 12s
remove clojure dep for CI
2026-09-19 05:54:32 -09:00

24 lines
810 B
Bash
Executable File

#!/usr/bin/env bash
# Run the unit tests under Cloverage inside the app image; needs only Docker. The report is
# copied out with `docker cp` (not a bind mount) so it works when this itself runs in a
# job container. Output: target/coverage/unit.
set -euo pipefail
cd "$(dirname "$0")/.."
source script/lib/docker.sh
build_unit_image
id=$(docker create --security-opt apparmor=unconfined vibe-unit \
clojure -M:cov -m cloverage.coverage \
--src-ns-path src --test-ns-path test \
--lcov --html --output target/coverage/unit)
trap 'docker rm -f "$id" >/dev/null' EXIT
status=0
docker start -a "$id" || status=$?
rm -rf target/coverage/unit
mkdir -p target/coverage
docker cp "$id:/app/target/coverage/unit" target/coverage/ || echo "[test] WARNING: no unit coverage report was produced"
exit "$status"