beffroi-reporting/scripts/check-components.sh

29 lines
1.1 KiB
Bash

#!/usr/bin/env bash
# Run the checks owned by the pinned components in separate environments.
set -euo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")/.."
command -v uv >/dev/null 2>&1 || {
echo 'uv is required to prepare isolated component test environments.' >&2
exit 1
}
for component in win-diagnostics reportist; do
if [[ ! -f "$component/requirements.txt" || ! -f "$component/tests/test_contract.py" ]]; then
echo "Missing $component checks. Run: git submodule update --init --recursive" >&2
exit 1
fi
done
uv --version
for component in win-diagnostics reportist; do
echo "Checking $component ($(git -C "$component" rev-parse HEAD))"
environment=".venv/component-checks/$component"
uv venv --python 3.11 --allow-existing "$environment"
uv pip sync --python "$environment/bin/python" "$component/requirements.txt"
"$environment/bin/python" --version
"$environment/bin/python" -m unittest discover -s "$component/tests" -p 'test_*.py' -v
done
echo 'Component contract checks passed. Full pipeline and PDF checks remain pending.'