Files
pkgmgr/scripts/test/test-env-virtual.sh
Kevin Veen-Birkenbach 866572e252
Some checks failed
Mark stable commit / test-unit (push) Has been cancelled
Mark stable commit / test-integration (push) Has been cancelled
Mark stable commit / test-env-virtual (push) Has been cancelled
Mark stable commit / test-env-nix (push) Has been cancelled
Mark stable commit / test-e2e (push) Has been cancelled
Mark stable commit / test-virgin-user (push) Has been cancelled
Mark stable commit / test-virgin-root (push) Has been cancelled
Mark stable commit / lint-shell (push) Has been cancelled
Mark stable commit / lint-python (push) Has been cancelled
Mark stable commit / mark-stable (push) Has been cancelled
ci(docker): fix repo mount path for pkgmgr as base layer of Infinito.Nexus
Standardize Docker/CI/test environments to mount pkgmgr at /opt/src/pkgmgr.
This makes the layering explicit: pkgmgr is the lower-level foundation used by
Infinito.Nexus.

Infra-only change (Docker, CI, shell scripts). No runtime or Nix semantics changed.

https://chatgpt.com/share/69427fe7-e288-800f-90a4-c1c3c11a8484
2025-12-17 11:03:02 +01:00

50 lines
1.3 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
IMAGE="pkgmgr-${PKGMGR_DISTRO}"
echo
echo "------------------------------------------------------------"
echo ">>> Testing VENV: ${IMAGE}"
echo "------------------------------------------------------------"
echo "[test-env-virtual] Inspect image metadata:"
docker image inspect "${IMAGE}" | sed -n '1,40p'
echo
# ------------------------------------------------------------
# Run VENV-based pkgmgr test inside container
# ------------------------------------------------------------
if OUTPUT=$(docker run --rm \
-e REINSTALL_PKGMGR=1 \
-v "$(pwd):/opt/src/pkgmgr" \
-w /opt/src/pkgmgr \
"${IMAGE}" \
bash -lc '
set -euo pipefail
echo "[test-env-virtual] Installing pkgmgr (distro package)..."
make install
echo "[test-env-virtual] Setting up Python venv..."
make setup-venv
echo "[test-env-virtual] Activating venv..."
. "$HOME/.venvs/pkgmgr/bin/activate"
echo "[test-env-virtual] Using pkgmgr from:"
command -v pkgmgr
pkgmgr --help
' 2>&1); then
echo "$OUTPUT"
echo
echo "[test-env-virtual] SUCCESS: venv-based pkgmgr works in ${IMAGE}"
else
echo "$OUTPUT"
echo
echo "[test-env-virtual] ERROR: venv-based pkgmgr failed in ${IMAGE}"
exit 1
fi