test: enforce coverage and publish badges

This commit is contained in:
Dandaedre 2026-09-29 12:53:29 +02:00
parent 84fefd4b01
commit 239b5198e4
Signed by: Dandaedre
GPG Key ID: 440C6592E8A26D99
10 changed files with 60 additions and 3 deletions

3
.gitignore vendored
View File

@ -20,3 +20,6 @@ target/
# Local implementation journal (intentionally not committed)
/recap.md
# Generated locally by rust_autobadges/Cargo Tarpaulin
/tarpaulin-report.html

8
.run_status.toml Normal file
View File

@ -0,0 +1,8 @@
[last_run_clean]
run_status = "Success"
lines_parsed = 114
coverage = 72.32
[last_run_clean.run_duration]
secs = 10
nanos = 643158348

View File

@ -219,9 +219,15 @@ Before considering a task complete, run:
cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings
cargo test --all-targets --all-features
cargo test --all-targets --no-default-features
cargo doc --no-deps
```
Run `cargo tarpaulin --config tarpaulin.toml` when tests or executable Rust code
change. It enforces the intentionally modest 30% line-coverage floor. Refresh
the tracked local badges with `rust_autobadges --high-coverage-percent 0.7
--mid-coverage-percent 0.3` after a clean test and coverage run.
Also run focused CLI golden tests and LSP protocol tests once those binaries
exist. Favor property tests for replacement idempotence/non-overlap and fuzz
targets for config parsing, span conversion, archives, and replacement planning.

24
Jenkinsfile vendored
View File

@ -8,6 +8,7 @@ pipeline {
CARGO_TERM_COLOR = 'always'
RUST_BACKTRACE = '1'
MSRV = '1.98.1'
TARPAULIN_VERSION = '0.37.4'
}
stages {
@ -52,6 +53,13 @@ pipeline {
cargo --version
rustfmt --version
cargo clippy --version
INSTALLED_TARPAULIN="$(cargo tarpaulin --version 2>/dev/null || true)"
if [ "${INSTALLED_TARPAULIN}" != "cargo-tarpaulin-tarpaulin ${TARPAULIN_VERSION}" ]; then
cargo install cargo-tarpaulin \
--locked \
--version "${TARPAULIN_VERSION}"
fi
'''
}
}
@ -128,6 +136,18 @@ pipeline {
}
}
stage('Coverage') {
steps {
sh '''
set -eu
echo "Measuring line coverage..."
cargo tarpaulin --config tarpaulin.toml
'''
}
}
stage('Clippy') {
steps {
sh '''
@ -173,7 +193,7 @@ pipeline {
conclusion: 'SUCCESS',
name: 'Rust CI',
summary: 'JohnSlop passed all CI checks.',
text: 'Formatting, compilation checks, tests, Clippy, and the release build completed successfully.',
text: 'Formatting, compilation checks, feature tests, coverage, Clippy, and the release build completed successfully.',
title: 'Build Successful'
)
@ -185,7 +205,7 @@ pipeline {
conclusion: 'FAILURE',
name: 'Rust CI',
summary: 'JohnSlop failed CI.',
text: 'Formatting, compilation, tests, Clippy, or the release build failed. Check the Jenkins log.',
text: 'Formatting, compilation, tests, coverage, Clippy, or the release build failed. Check the Jenkins log.',
title: 'Build Failed'
)

View File

@ -1,5 +1,9 @@
# John Slop
![version](badges/version.svg)
![tests](badges/test.svg)
![test coverage](badges/coverage.svg)
John Slop is an early-stage, local-first heuristic linter for concrete signals
of low-effort or insufficiently reviewed text and source code. It is intended to
highlight evidence for human review, not to prove that content was written by AI

1
badges/coverage.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="122" height="18" role="img" aria-label="test-coverage: 72%"><title>test-coverage: 72%</title><linearGradient id="bms-fd246ae864179eba" x2="0" y2="100%"><stop offset="0" stop-color="#fff" stop-opacity=".7"/><stop offset=".1" stop-color="#aaa" stop-opacity=".1"/><stop offset=".9" stop-color="#000" stop-opacity=".3"/><stop offset="1" stop-color="#000" stop-opacity=".5"/></linearGradient><clipPath id="bmr-fd246ae864179eba"><rect width="122" height="18" rx="4" fill="#fff"/></clipPath><g clip-path="url(#bmr-fd246ae864179eba)"><rect width="87" height="18" fill="#555"/><rect x="87" width="35" height="18" fill="#97ca00"/><rect width="122" height="18" fill="url(#bms-fd246ae864179eba)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="445" y="140" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="770">test-coverage</text><text x="445" y="130" transform="scale(.1)" fill="#fff" textLength="770">test-coverage</text><text aria-hidden="true" x="1035" y="140" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="250">72%</text><text x="1035" y="130" transform="scale(.1)" fill="#fff" textLength="250">72%</text></g></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

1
badges/test.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="82" height="18" role="img" aria-label="test: passing"><title>test: passing</title><linearGradient id="bms-5402c39dce014bd3" x2="0" y2="100%"><stop offset="0" stop-color="#fff" stop-opacity=".7"/><stop offset=".1" stop-color="#aaa" stop-opacity=".1"/><stop offset=".9" stop-color="#000" stop-opacity=".3"/><stop offset="1" stop-color="#000" stop-opacity=".5"/></linearGradient><clipPath id="bmr-5402c39dce014bd3"><rect width="82" height="18" rx="4" fill="#fff"/></clipPath><g clip-path="url(#bmr-5402c39dce014bd3)"><rect width="31" height="18" fill="#555"/><rect x="31" width="51" height="18" fill="#97ca00"/><rect width="82" height="18" fill="url(#bms-5402c39dce014bd3)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="165" y="140" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="210">test</text><text x="165" y="130" transform="scale(.1)" fill="#fff" textLength="210">test</text><text aria-hidden="true" x="555" y="140" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="410">passing</text><text x="555" y="130" transform="scale(.1)" fill="#fff" textLength="410">passing</text></g></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

1
badges/version.svg Normal file
View File

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="90" height="18" role="img" aria-label="version: 0.1.0"><title>version: 0.1.0</title><linearGradient id="bms-0431e50b7af7883f" x2="0" y2="100%"><stop offset="0" stop-color="#fff" stop-opacity=".7"/><stop offset=".1" stop-color="#aaa" stop-opacity=".1"/><stop offset=".9" stop-color="#000" stop-opacity=".3"/><stop offset="1" stop-color="#000" stop-opacity=".5"/></linearGradient><clipPath id="bmr-0431e50b7af7883f"><rect width="90" height="18" rx="4" fill="#fff"/></clipPath><g clip-path="url(#bmr-0431e50b7af7883f)"><rect width="51" height="18" fill="#555"/><rect x="51" width="39" height="18" fill="#fe7d37"/><rect width="90" height="18" fill="url(#bms-0431e50b7af7883f)"/></g><g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" text-rendering="geometricPrecision" font-size="110"><text aria-hidden="true" x="265" y="140" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="410">version</text><text x="265" y="130" transform="scale(.1)" fill="#fff" textLength="410">version</text><text aria-hidden="true" x="695" y="140" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="290">0.1.0</text><text x="695" y="130" transform="scale(.1)" fill="#fff" textLength="290">0.1.0</text></g></svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

13
tarpaulin.toml Normal file
View File

@ -0,0 +1,13 @@
[coverage]
all-features = true
engine = "Llvm"
fail-under = 30.0
locked = true
run-types = ["Tests"]
[report]
out = ["Stdout"]
# CLI behavior is covered by subprocess integration tests. Tarpaulin may not
# attribute those child-process lines on every backend, so the enforced floor is
# intentionally modest and the badge reports the directly measured result.

View File

@ -72,7 +72,7 @@ entry do not discard successful documents.
stable releases; verify the locked graph with the declared toolchain.
- [x] Add focused behavioral and snapshot tests, including feature-matrix
coverage, without snapshotting structured domain values unnecessarily.
- [ ] Configure Tarpaulin with an enforceable coverage floor around 30%, run
- [x] Configure Tarpaulin with an enforceable coverage floor around 30%, run
`rust_autobadges`, and publish local version/test/coverage badges.
- [ ] Reduce the root README to a generic project landing page and move detailed
usage, architecture, testing, coverage, and background links under `docs/`.