2025-12-09 05:31:55 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
|
|
echo "============================================================"
|
2025-12-13 14:34:15 +01:00
|
|
|
echo ">>> Running UNIT tests in ${PKGMGR_DISTRO} container"
|
2025-12-09 05:31:55 +01:00
|
|
|
echo "============================================================"
|
|
|
|
|
|
|
|
|
|
docker run --rm \
|
2025-12-17 11:03:02 +01:00
|
|
|
-v "$(pwd):/opt/src/pkgmgr" \
|
2025-12-13 14:34:15 +01:00
|
|
|
-v "pkgmgr_nix_cache_${PKGMGR_DISTRO}:/root/.cache/nix" \
|
2025-12-13 14:38:37 +01:00
|
|
|
-v "pkgmgr_nix_store_${PKGMGR_DISTRO}:/nix" \
|
2025-12-17 11:03:02 +01:00
|
|
|
--workdir /opt/src/pkgmgr \
|
2025-12-12 15:42:25 +01:00
|
|
|
-e REINSTALL_PKGMGR=1 \
|
2025-12-09 17:53:10 +01:00
|
|
|
-e TEST_PATTERN="${TEST_PATTERN}" \
|
2025-12-13 14:34:15 +01:00
|
|
|
"pkgmgr-${PKGMGR_DISTRO}" \
|
2025-12-11 14:06:39 +01:00
|
|
|
bash -lc '
|
2025-12-09 05:31:55 +01:00
|
|
|
set -e;
|
2025-12-17 11:03:02 +01:00
|
|
|
git config --global --add safe.directory /opt/src/pkgmgr || true;
|
2025-12-09 05:31:55 +01:00
|
|
|
nix develop .#default --no-write-lock-file -c \
|
2025-12-11 09:33:55 +01:00
|
|
|
python3 -m unittest discover \
|
2025-12-09 05:31:55 +01:00
|
|
|
-s tests/unit \
|
2025-12-17 11:03:02 +01:00
|
|
|
-t /opt/src/pkgmgr \
|
2025-12-09 17:53:10 +01:00
|
|
|
-p "$TEST_PATTERN";
|
2025-12-09 05:31:55 +01:00
|
|
|
'
|