46 lines
1.9 KiB
Bash
46 lines
1.9 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 "Checking beffroi-reports ($(git -C beffroi-reports rev-parse HEAD))"
|
|
python3 --version
|
|
python3 -m unittest discover -s beffroi-reports/tests -p 'test_*.py' -v
|
|
|
|
adapter_check_root="$(mktemp -d "${TMPDIR:-/tmp}/beffroi-adapter-check.XXXXXX")"
|
|
trap 'rm -rf -- "$adapter_check_root"' EXIT
|
|
".venv/component-checks/reportist/bin/python" beffroi-reports/tools/diagnostic-to-report.py \
|
|
--diagnostic beffroi-reports/tests/fixtures/diagnostic.json \
|
|
--evidence-root beffroi-reports/tests/fixtures \
|
|
--output-dir "$adapter_check_root/generation" \
|
|
--title 'Synthetic diagnostic draft' \
|
|
--author 'CI Test' \
|
|
--date 2026-09-15 \
|
|
--generator-version "$(git -C beffroi-reports rev-parse HEAD)" \
|
|
--diagnostic-validator win-diagnostics/tools/validate.py \
|
|
--report-validator reportist/tools/validate.py
|
|
|
|
echo 'Contract and adapter checks passed. Analysis and PDF checks remain pending.'
|