Files
computer-playbook/scripts/tests/code.sh
T
kevinveenbirkenbach d35e932e0c refactor(cli): switch development CLI to dynamic dispatcher and fix test paths
- Replace static argparse-based CLI in cli.deploy.development with dynamic
  module dispatcher compatible with nested command discovery.
- Ensure cli.deploy.development is executable via python -m and root dispatcher.
- Fix unit test path resolution to work locally and in CI.
- Make docker-* Makefile targets depend on install.
- Simplify test runner script and keep Nix flake config compatibility.

This aligns the CLI architecture with integration test discovery
(cli/**/__main__.py) and removes the need for manual subcommand registration.

https://chatgpt.com/share/696fdbbc-b6d8-800f-a8b5-067aa7e38706
2026-01-20 20:46:20 +01:00

29 lines
752 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
echo "============================================================"
echo ">>> Running UNIT tests "
echo "============================================================"
: "${TEST_PATTERN:?TEST_PATTERN must be set}"
: "${TEST_TYPE:?TEST_TYPE must be set}"
set -euo pipefail
# Keep old NIX flake behavior
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}"
export PATH="$(dirname "$PYTHON"):$PATH"
make setup
"$PYTHON" -m unittest discover -s tests/${TEST_TYPE} -t . -p "${TEST_PATTERN}"