#!/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 diagnostics reporter reports; do if [[ ! -f "$component/requirements.txt" || ! -d "$component/tests" || ! -f "$component/Makefile" ]]; 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 diagnostics reporter; do echo "Checking $component ($(git -C "$component" rev-parse HEAD))" make -C "$component" test done echo "Checking reports ($(git -C reports rev-parse HEAD))" DIAGNOSTIC_VALIDATOR="$(pwd)/diagnostics/tools/validate.sh" \ REPORT_VALIDATOR="$(pwd)/reporter/tools/validate.sh" \ BRANDING="$(pwd)/reports/config/branding/default.json" \ BRANDING_ROOT="$(pwd)/reports" \ BRANDING_DIRECTORY="$(pwd)/reports/config/branding" \ make -C reports test 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 \ diagnostics/tests/fixtures/legacy/windiagnostics-v1.json \ diagnostics/tests/fixtures/legacy \ "$pipeline_check_root" \ 2026-09-15T12:00:00Z \ 'Synthetic diagnostic draft' 'CI Test' 2026-09-15 jq -e '.findings[0].id == "event-service-control-manager-7000" and .findings[0].evidence == ["event-recent_system_errors-1"]' "$pipeline_check_root/diagnostic.json" >/dev/null 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.'