Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion .github/workflows/spec-drift-guard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,30 @@ jobs:
fi
exit $STATUS

- name: Cargo test targets — every tests/*.rs must be declared
working-directory: tri-net
run: |
# Cargo.toml sets `autotests = false`, so a test file is compiled ONLY
# if it has an explicit [[test]] block. A file dropped into tests/ is
# therefore silently never run -- it LOOKS like coverage and is not.
# That is how tests/compute_ring_invariants.rs (18 load-bearing
# invariants, written precisely because spec test blocks are not
# executed) sat dead in the repo. Fail loudly on any undeclared file.
STATUS=0
declared=$(grep -oE 'tests/[a-z0-9_]+\.rs' Cargo.toml | sort -u)
present=$(ls tests/*.rs | sort)
missing=$(comm -13 <(printf '%s\n' "$declared") <(printf '%s\n' "$present"))
if [ -n "$missing" ]; then
echo "::error::these test files are NOT declared in Cargo.toml and never run:"
echo "$missing" | sed 's/^/ - /'
echo "Add a [[test]] block (name + path) for each, or delete the file."
STATUS=1
fi
n_decl=$(printf '%s\n' "$declared" | sed '/^$/d' | wc -l | tr -d ' ')
n_file=$(printf '%s\n' "$present" | sed '/^$/d' | wc -l | tr -d ' ')
echo "cargo test targets: ${n_file} files, ${n_decl} declared"
exit $STATUS

- name: Zig test — execute committed gens (passing set)
working-directory: tri-net
run: |
Expand Down Expand Up @@ -297,7 +321,7 @@ jobs:
STATUS=1
fi
done <<'BACKENDS'
rust rs gen-rust 86
rust rs gen-rust 96
zig zig gen 107
c c gen-c 75
BACKENDS
Expand Down
4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -354,3 +354,7 @@ path = "tests/dispute_witness.rs"
[[test]]
name = "witness_economics"
path = "tests/witness_economics.rs"

[[test]]
name = "compute_ring_invariants"
path = "tests/compute_ring_invariants.rs"
Loading
Loading