Files
computer-playbook/scripts/tests/code.sh
T
kevinveenbirkenbach fdcc910ce9 fix(tests, docker): pin Python venv inside image and stop leaking host PYTHON
- Define PYTHON and PIP explicitly in Dockerfile (/opt/venvs/infinito)
- Remove PYTHON env passthrough from test container runs
- Prevent host virtualenv paths from breaking container tests
- Align .dockerignore build path handling

https://chatgpt.com/share/6946f090-52b8-800f-919d-d534ae4ea163
2025-12-20 20:16:54 +01:00

25 lines
762 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
echo "============================================================"
echo ">>> Running UNIT tests in ${INFINITO_DISTRO} container"
echo "============================================================"
docker run --rm \
-e INSTALL_LOCAL_BUILD=1 \
-e TEST_PATTERN="${TEST_PATTERN}" \
-e TEST_TYPE="${TEST_TYPE}" \
-v "$(pwd):/opt/src/infinito" \
"infinito-${INFINITO_DISTRO}" \
bash -lc '
set -euo pipefail
cd /opt/src/infinito
echo "PWD=$(pwd)"
echo "PYTHON=${PYTHON}"
export PATH="$(dirname "$PYTHON"):$PATH"
# Ensure we really use the exported interpreter (and thus the global venv)
make setup
"${PYTHON}" -m unittest discover -s tests/${TEST_TYPE} -t . -p "${TEST_PATTERN}"
'