build: replace make with test script

This commit is contained in:
Dandaedre 2026-09-16 01:31:01 +02:00
parent 67e3687b50
commit b71c168a7f
Signed by: Dandaedre
GPG Key ID: 440C6592E8A26D99
6 changed files with 15 additions and 39 deletions

2
Jenkinsfile vendored
View File

@ -12,7 +12,7 @@ pipeline {
}
stage('Test') {
steps { sh 'make test' }
steps { sh './test.sh' }
}
}

View File

@ -1,22 +0,0 @@
.PHONY: help render validate test check
INPUT ?= examples/example-report.yaml
OUTPUT ?= build/report.pdf
help:
@echo 'make render INPUT=report.yaml OUTPUT=report.pdf'
@echo 'make validate INPUT=report.yaml'
@echo 'make test'
render:
bash tools/render.sh "$(INPUT)" --output "$(OUTPUT)"
validate:
bash tools/validate.sh "$(INPUT)"
test:
uv venv --python 3.11 --allow-existing .venv
uv pip sync --python .venv/bin/python requirements.txt
.venv/bin/python -m unittest discover -s tests -p 'test_*.py' -v
check: test

View File

@ -19,14 +19,6 @@ and DejaVu Sans Mono.
## Render a report
```bash
make render \
INPUT=examples/example-report.yaml \
OUTPUT=output/example-report.pdf
```
Or call the renderer directly:
```bash
bash tools/render.sh report.yaml --output report.pdf
```
@ -45,7 +37,7 @@ command name.
## Validate a report
```bash
make validate INPUT=examples/example-report.yaml
bash tools/validate.sh examples/example-report.yaml
```
The version 1 format supports metadata, branding, summaries, timelines,

View File

@ -6,11 +6,11 @@ authoring are documented in the main [README](../README.md) and
## Test environment
Tests require uv and Typst. The Makefile creates `.venv`, synchronizes the pinned
Tests require uv and Typst. `test.sh` creates `.venv` and synchronizes the pinned
packages from `requirements.txt`, and invokes Python only from that environment.
```bash
make test
./test.sh
```
Poppler's `pdfinfo` and `pdftotext` enable additional pagination and extracted

View File

@ -9,12 +9,12 @@ PDF rendering are implemented by the standalone component.
Typst and Bash are required at runtime. From this component checkout:
```bash
make validate INPUT=examples/example-report.yaml
make validate INPUT=examples/example-report.json
make test
bash tools/validate.sh examples/example-report.yaml
bash tools/validate.sh examples/example-report.json
./test.sh
```
`make test` creates and synchronizes `.venv` with uv before invoking Python.
`./test.sh` creates and synchronizes `.venv` with uv before invoking Python.
Python is not used by validation or rendering. Validation needs no sibling repositories and works
from any working directory using explicit paths. It writes no files. Exit codes:
0 valid, 1 invalid/unreadable input or missing dependencies, 2 CLI usage error.
@ -25,7 +25,7 @@ Errors identify the offending JSON path; unsupported file extensions are rejecte
After installing Typst:
```bash
make render INPUT=examples/example-report.yaml OUTPUT=output/report.pdf
bash tools/render.sh examples/example-report.yaml --output output/report.pdf
```
Validation always runs before Typst. Relative branding assets resolve from the

6
test.sh Executable file
View File

@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -euo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")"
uv venv --python 3.11 --allow-existing .venv
uv pip sync --python .venv/bin/python requirements.txt
.venv/bin/python -m unittest discover -s tests -p 'test_*.py' -v