diff --git a/Jenkinsfile b/Jenkinsfile index 703fa6c..679e812 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -12,7 +12,7 @@ pipeline { } stage('Test') { - steps { sh 'make test' } + steps { sh './test.sh' } } } diff --git a/Makefile b/Makefile deleted file mode 100644 index 00de28f..0000000 --- a/Makefile +++ /dev/null @@ -1,16 +0,0 @@ -.PHONY: help analyse validate test check -INPUT ?= examples/diagnostic.json - -help: - @echo 'make analyse INPUT=... EVIDENCE_ROOT=... OUTPUT=... REFERENCE_TIME=...' - @echo 'make validate INPUT=... EVIDENCE_ROOT=...' - @echo 'make test' -analyse: - bash tools/analyse.sh "$(INPUT)" --evidence-root "$(EVIDENCE_ROOT)" --output "$(OUTPUT)" --reference-time "$(REFERENCE_TIME)" --producer-version "$$(git rev-parse HEAD)" -validate: - bash tools/validate.sh "$(INPUT)" --evidence-root "$(EVIDENCE_ROOT)" -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 diff --git a/docs/development.md b/docs/development.md index eb058b1..fedbfe0 100644 --- a/docs/development.md +++ b/docs/development.md @@ -5,11 +5,11 @@ is documented in the main [README](../README.md). ## Test environment -Tests require uv. The Makefile creates `.venv`, synchronizes the pinned packages +Tests require uv. `test.sh` creates `.venv` and synchronizes the pinned packages from `requirements.txt`, and invokes Python only from that environment. ```bash -make test +./test.sh ``` The suite covers diagnostic contract validation, evidence hashes and JSON @@ -29,7 +29,7 @@ When changing a rule: 1. Add or update a sanitized fixture that exercises the behavior. 2. Verify finding identity, severity, confidence, and evidence references. 3. Confirm incomplete collection cannot imply a healthy result. -4. Run `make test` and `git diff --check`. +4. Run `./test.sh` and `git diff --check`. ## Contract changes diff --git a/docs/diagnostic-contract.md b/docs/diagnostic-contract.md index 305b577..afd9c6a 100644 --- a/docs/diagnostic-contract.md +++ b/docs/diagnostic-contract.md @@ -9,9 +9,9 @@ examples, not a migrated collector or analysis engine. Bash and Typst 0.15 or newer are required at runtime. From a standalone component checkout: ```bash -make validate INPUT=examples/diagnostic.json -make validate INPUT=examples/diagnostic.json EVIDENCE_ROOT=tests/fixtures/legacy -make test +bash tools/validate.sh examples/diagnostic.json +bash tools/validate.sh examples/diagnostic.json --evidence-root tests/fixtures/legacy +./test.sh ``` The test target creates a uv-managed Python environment and synchronizes the diff --git a/docs/standalone.md b/docs/standalone.md index 4e23c6b..56511cd 100644 --- a/docs/standalone.md +++ b/docs/standalone.md @@ -8,7 +8,7 @@ beffroi-reports, the integration workspace, and legacy sources are not runtime dependencies. ```bash -make test +./test.sh ``` ```bash diff --git a/test.sh b/test.sh new file mode 100755 index 0000000..eff8349 --- /dev/null +++ b/test.sh @@ -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