Files
computer-playbook/scripts/tests/code.sh
T
kevinveenbirkenbach 18acafa9dc ci(images): build & push full+slim CI images
- Build matrix now includes variants: full + slim
- Tag slim images with -slim suffix and use Dockerfile target selection
- Use dedicated gha cache scopes per distro+variant
- Update release checks/retag/promote scripts to handle slim images too

https://chatgpt.com/share/69701a4e-b000-800f-be7e-162dcb93b1d2
2026-01-21 01:46:52 +01:00

40 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
echo "============================================================"
echo ">>> Running UNIT tests in ${INFINITO_DISTRO:-<unset>} container (compose stack)"
echo "============================================================"
: "${INFINITO_DISTRO:?INFINITO_DISTRO must be set}"
: "${TEST_PATTERN:?TEST_PATTERN must be set}"
: "${TEST_TYPE:?TEST_TYPE must be set}"
# Execute directly inside the already running infinito container
INFINITO_DISTRO="${INFINITO_DISTRO}" \
docker compose --profile ci exec -T \
-e TEST_PATTERN="${TEST_PATTERN}" \
-e TEST_TYPE="${TEST_TYPE}" \
--workdir /opt/src/infinito \
infinito \
bash -lc '
set -euo pipefail
NIX_CONFIG_EFFECTIVE="$(
printf "%s\n%s\n" \
"${NIX_CONFIG:-}" \
"accept-flake-config = true" \
| sed -e "s/[[:space:]]\+$//" -e "/^$/d"
)"
export NIX_CONFIG="${NIX_CONFIG_EFFECTIVE}"
echo "PWD=$(pwd)"
echo "PYTHON=${PYTHON:-<unset>}"
if [ -n "${PYTHON:-}" ]; then
export PATH="$(dirname "$PYTHON"):$PATH"
fi
make setup
"${PYTHON}" -m unittest discover -s "tests/${TEST_TYPE}" -t . -p "${TEST_PATTERN}"
'