74 lines
3.0 KiB
Bash
Executable File
74 lines
3.0 KiB
Bash
Executable File
#!/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 reports; do
|
|
if [[ ! -f "$component/tests/requirements.txt" || ! -x "$component/tests/test.sh" ]]; then
|
|
echo "Missing $component checks. Run: git submodule update --init --recursive" >&2
|
|
exit 1
|
|
fi
|
|
done
|
|
if [[ ! -f reporter/tests/requirements.txt || ! -x reporter/render.sh || ! -x reporter/tests/test.sh ]]; then
|
|
echo "Missing reporter entrypoint or checks. Run: git submodule update --init --recursive" >&2
|
|
exit 1
|
|
fi
|
|
|
|
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 reports/plugins/diagnostics; do
|
|
echo "Checking $component ($(git -C reports rev-parse HEAD))"
|
|
"$component/tests/test.sh"
|
|
done
|
|
|
|
echo "Checking reporter ($(git -C reporter rev-parse HEAD))"
|
|
reporter/tests/test.sh
|
|
|
|
echo "Checking reports ($(git -C reports rev-parse HEAD))"
|
|
DIAGNOSTIC_VALIDATOR="$(pwd)/reports/plugins/diagnostics/tools/validate.sh" \
|
|
REPORT_VALIDATOR="$(pwd)/reporter/tools/validate.sh" \
|
|
BRANDING="$(pwd)/reports/plugins/diagnostics/runtime/themes/default.json" \
|
|
BRANDING_ROOT="$(pwd)/reports" \
|
|
BRANDING_DIRECTORY="$(pwd)/reports/plugins/diagnostics/runtime/themes" \
|
|
reports/tests/test.sh
|
|
|
|
echo 'Checking stored Reportist YAML'
|
|
reporter/tools/validate-all.sh reports/reports
|
|
|
|
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 \
|
|
reports/plugins/diagnostics/tests/fixtures/legacy/windiagnostics-v1.json \
|
|
reports/plugins/diagnostics/tests/fixtures/legacy \
|
|
"$pipeline_check_root" \
|
|
2026-09-15T12:00:00Z \
|
|
'Synthetic diagnostic draft' 'CI Test' 2026-09-15
|
|
cp scripts/check-diagnostic.typ "$pipeline_check_root/check-diagnostic.typ"
|
|
typst eval --root "$pipeline_check_root" --input diagnostic=diagnostic.json \
|
|
--in "$pipeline_check_root/check-diagnostic.typ" \
|
|
'query(<valid>).first().value' >/dev/null
|
|
test "$(head -c 5 "$pipeline_check_root/report.pdf")" = '%PDF-'
|
|
|
|
reporter/render.sh "$pipeline_check_root/diagnostic.json" \
|
|
--plugin reports/plugins/diagnostics --plugin-input theme=eridani \
|
|
--plugin-input 'author=CI Test' --output "$pipeline_check_parent/plugin.pdf" \
|
|
--emit-ir "$pipeline_check_parent/plugin.ir.json"
|
|
reporter/tools/validate.sh "$pipeline_check_parent/plugin.ir.json"
|
|
reporter/render.sh "$pipeline_check_parent/plugin.ir.json" \
|
|
--output "$pipeline_check_parent/replayed.pdf"
|
|
test "$(head -c 5 "$pipeline_check_parent/replayed.pdf")" = '%PDF-'
|
|
test "$(head -c 5 "$pipeline_check_parent/plugin.pdf")" = '%PDF-'
|
|
|
|
echo 'Component suites and the raw-capture-to-PDF integration pipeline passed.'
|