58 lines
2.5 KiB
Bash
58 lines
2.5 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
|
|
|
|
command -v typst >/dev/null 2>&1 || {
|
|
echo 'Typst is required for Reportist rendering checks.' >&2
|
|
exit 1
|
|
}
|
|
typst --version
|
|
|
|
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))"
|
|
DIAGNOSTIC_VALIDATOR="$(pwd)/win-diagnostics/tools/validate.py" \
|
|
REPORT_VALIDATOR="$(pwd)/reportist/tools/validate.py" \
|
|
BRANDING="$(pwd)/beffroi-reports/config/branding/default.json" \
|
|
BRANDING_ROOT="$(pwd)/beffroi-reports" \
|
|
BRANDING_DIRECTORY="$(pwd)/beffroi-reports/config/branding" \
|
|
.venv/component-checks/reportist/bin/python -m unittest discover \
|
|
-s beffroi-reports/tests -p 'test_*.py' -v
|
|
|
|
pipeline_check_parent="$(mktemp -d "${TMPDIR:-/tmp}/beffroi-pipeline-check.XXXXXX")"
|
|
trap 'rm -rf -- "$pipeline_check_parent"' EXIT
|
|
pipeline_check_root="$pipeline_check_parent/run"
|
|
bash scripts/workflow.sh all \
|
|
win-diagnostics/tests/fixtures/legacy/windiagnostics-v1.json \
|
|
win-diagnostics/tests/fixtures/legacy \
|
|
"$pipeline_check_root" \
|
|
2026-09-15T12:00:00Z \
|
|
'Synthetic diagnostic draft' 'CI Test' 2026-09-15
|
|
.venv/component-checks/win-diagnostics/bin/python -c \
|
|
'import json,sys; d=json.load(open(sys.argv[1], encoding="utf-8")); assert d["findings"][0]["id"] == "event-service-control-manager-7000"; assert d["findings"][0]["evidence"] == ["event-recent_system_errors-1"]' \
|
|
"$pipeline_check_root/diagnostic.json"
|
|
test "$(head -c 5 "$pipeline_check_root/report.pdf")" = '%PDF-'
|
|
|
|
echo 'Raw-capture analysis, adapter, and PDF pipeline passed. Native collection and non-event health checks remain.'
|