Repository navigation
ci: add coverage (tarpaulin) + CRAP gates - #4
Merged
Merged
Conversation
- one job, one tarpaulin run under the llvm engine feeding both gates - pinned tools: tarpaulin 0.37.5, cargo-crap 0.6.1 (version-asserted) - floor 3% (measured 5.97%% ptrace / 5.67%% llvm: 8/134 lines) as a measured-level regression tripwire - CRAP ceiling 80 (worst maintained-surface function patch_index_html at 72, CC 8) - public repo: ubuntu-latest; shell-only summary that cannot fail the build
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Gates added
One new job
coverage + CRAPin.github/workflows/ci.yml: a single tarpaulin run under the llvm engine (one instrumented run IS the test run — tarpaulin exits non-zero on any test failure) writeslcov.info, which cargo-crap then scores. The two gates share the run because CRAP without a coverage feed scores every functioncov=0and measures nothing.Public repo, so the job runs on
ubuntu-latestfollowing this repo's existing convention (pages.yml). This check is intended to become required once green (branch protection is wired separately after the run exists).Is this crate even gateable natively?
dwasm is a build tool for wasm frontends, not a wasm-only crate:
Cargo.tomlhas nocrate-type = ["cdylib"], no wasm-bindgen dependency, and the binary is a native clap CLI that shells out tocargo build --target wasm32-unknown-unknown,wasm-bindgen, andwasm-opt. Verified before shipping: the suite compiles and runs natively (6/6 tests pass) under both engines. Norust-toolchain.toml, so the toolchain step installs stable explicitly.Measured numbers (first run, on the build host)
patch_index_html(src/main.rs:202, CC 8)clean_old_artifacts42 (CC 6),main42 (CC 6),find_crate_dir/find_wasm_opt20 (CC 4)Coverage is low by measurement, not by failure: the suite exercises pure helpers (content hashing, reference extraction, stale-artifact cleanup) and never invokes the external toolchains in main()'s 5-step pipeline. The floor is therefore a regression tripwire at measured level, not a coverage target.
Thresholds
--path srcscores the whole crate surface; the CLI entrymainscores 42, below the worst function, so no artificial exclusion is needed and the ceiling measures the real surface.Tooling pins
tarpaulin 0.37.5 and cargo-crap 0.6.1, installed from per-arch release tarballs with the exact versions asserted in the same step (
$GITHUB_PATHonly affects later steps). Cargo.lock is committed and enforced via--lockedplus a guard step.Engine note
--engine Ptraceis blocked on the fleet's sysbox-confined runner containers (ASLR disable failed: EPERM: Operation not permitted, measured on dirmacs/skywalkers run 38064108686);autowould fall back silently. The job uses the documentedLlvmengine withllvm-tools-preview. Both engines were measured on the host and agree within the floor's margin.Summary step
Shell-only (no python3 on runner images — a crashing tracker must never repaint a green gate red) and structurally unable to fail the build (
|| true).Ratchet
patch_index_html(CC 8, CRAP 72): extract its hashed-reference rewriting and integrity-stripping loops into tested helpers — that both lowers the CRAP ceiling (room opens under the current 80) and raises coverage.Caveats
Cargo.lockis committed and enforced.