open-standards/scripts/check-tests-in-ci-selftest.sh
Transaction Science e2392f920a
Some checks failed
repository checks / lockfiles, tests in CI, workflow hygiene, spec and section references, public text (pull_request) Successful in 58s
standards workspaces build + test / which workspaces this change touches (pull_request) Successful in 5s
WAI conformance / does this change touch it (pull_request) Successful in 4s
WAI energy receipts / does this change touch it (pull_request) Successful in 4s
WAI JPEG-AI whole decode (pinned inputs, required) / does this change touch it (pull_request) Successful in 5s
WAI neural sink gates / does this change touch it (pull_request) Successful in 5s
wai-quantum CUDA member / does this change touch it (pull_request) Successful in 4s
wai-quantum dataflow member / does this change touch it (pull_request) Successful in 4s
wai-quantum signal processor / does this change touch it (pull_request) Successful in 4s
wai-quantum FPGA member / does this change touch it (pull_request) Successful in 10s
wai-quantum neural-processor member / does this change touch it (pull_request) Successful in 4s
wai-quantum OpenCL member / does this change touch it (pull_request) Successful in 4s
wai-quantum-qpu / does this change touch it (pull_request) Successful in 4s
wai-quantum matrix-extension member / does this change touch it (pull_request) Successful in 4s
wai-quantum CPU vector units / does this change touch it (pull_request) Successful in 4s
wai-quantum WebGPU member / does this change touch it (pull_request) Successful in 4s
WAI mbt2018_mean integer decode (regenerated vectors) / does this change touch it (pull_request) Successful in 4s
wai-web wasm32 / does this change touch it (pull_request) Successful in 4s
standards workspaces build + test / jouleclaw-rs (-nodebug, jouleclaw/jouleclaw-rs, -p jouleclaw-energy --features rapl,nvml, jouleclaw-rs, linux-arm64, -C target-feature=+fp16) (pull_request) Successful in 2m28s
wai-quantum CUDA member / member · CUDA (jetson-hub) (pull_request) Successful in 16s
wai-quantum OpenCL member / member · OpenCL GPU and CPU (jetson-hub) (pull_request) Successful in 23s
standards workspaces build + test / aac-rs (aac-conformance, aac/aac-rs, aac-rs, linux-arm64) (pull_request) Successful in 2m46s
standards workspaces build + test / joulecontract-rs (joulecontract/joulecontract-rs, joulecontract-rs, linux-arm64, true) (pull_request) Successful in 55s
standards workspaces build + test / joule-code-rs (joule-code/joule-code-rs, joule-code-rs, linux-arm64, true) (pull_request) Successful in 1m24s
standards workspaces build + test / map-rs (map-conformance, map/map-rs, map-rs, linux-arm64) (pull_request) Successful in 56s
standards workspaces build + test / mesh-rs (mesh/mesh-rs, -p mesh-engine-gguf -p mesh-openai --features mesh-engine-gguf/gguf,mesh-openai/server, mesh-rs, linux-arm64) (pull_request) Successful in 55s
standards workspaces build + test / openpay (openpay, openpay, linux-arm64) (pull_request) Successful in 3m11s
WAI conformance / cross-arch byte-equality · linux-arm64 (pull_request) Successful in 26s
WAI energy receipts / energy receipts · linux-arm64 (pull_request) Successful in 2m7s
WAI conformance / cargo-class corpora · linux-arm64 (pull_request) Successful in 9m29s
wai-quantum WebGPU member / member · discrete GPU, Vulkan (jetson-hub) (pull_request) Successful in 19m31s
wai-quantum WebGPU member / member · DX12 and Vulkan (cbio-windows) (pull_request) Successful in 11m56s
standards workspaces build + test / macOS energy backends (pull_request) Successful in 5m12s
standards workspaces build + test / jouledesk-rs (jouledesk/jouledesk-rs, jouledesk-rs, macos) (pull_request) Successful in 54s
WAI conformance / cargo-class corpora · macos (pull_request) Successful in 6m44s
WAI conformance / cross-arch byte-equality · macos (pull_request) Successful in 18s
WAI conformance / codec wrappers · fuzz smoke, text decode limits, C entry points, provenance, the semantic path (pull_request) Successful in 38s
WAI energy receipts / energy receipts · macos (pull_request) Successful in 1m29s
wai-quantum dataflow member / member · dataflow device absent (macos) (pull_request) Successful in 11s
wai-quantum FPGA member / member · FPGA datapath, simulated (macos) (pull_request) Successful in 1m2s
wai-quantum neural-processor member / member · neural processor (macos) (pull_request) Successful in 5m52s
wai-quantum OpenCL member / member · OpenCL GPU (macos) (pull_request) Successful in 21s
wai-quantum matrix-extension member / member · matrix extension absent (macos) (pull_request) Successful in 9s
wai-quantum CPU vector units / member · vector unit absent (macos) (pull_request) Successful in 12s
wai-quantum WebGPU member / member · Metal (macos) (pull_request) Successful in 2m36s
wai-quantum WebGPU member / member · browser WebGPU (macos) (pull_request) Successful in 1m45s
wai-pack / wai-pack · does this change touch it (pull_request) Successful in 5s
wai-quantum on every processor / emulated · aarch64-unknown-linux-gnu (pull_request) Successful in 1m28s
wai-pack / wai-pack · macos (pull_request) Successful in 2m27s
wai-quantum on every processor / emulated · armv7-unknown-linux-gnueabihf (pull_request) Successful in 1m34s
wai-quantum on every processor / emulated · loongarch64-unknown-linux-gnu (pull_request) Successful in 2m51s
wai-quantum on every processor / emulated · powerpc64-unknown-linux-gnu (pull_request) Successful in 4m45s
wai-quantum on every processor / emulated · powerpc64le-unknown-linux-gnu (pull_request) Successful in 5m13s
wai-quantum on every processor / emulated · riscv64gc-unknown-linux-gnu (pull_request) Successful in 3m24s
wai-quantum on every processor / emulated · s390x-unknown-linux-gnu (pull_request) Successful in 3m23s
wai-quantum on every processor / emulated · sparc64-unknown-linux-gnu (pull_request) Successful in 5m22s
wai-web reach builds / wai-web reach · does this change touch it (pull_request) Successful in 5s
wai-quantum on every processor / emulated · i686-unknown-linux-gnu (pull_request) Successful in 3m30s
wai-pack / wai-pack · linux-arm64 (pull_request) Successful in 1m26s
standards workspaces build + test / arl-rs (arl/arl-rs, arl-rs, linux) (pull_request) Successful in 1m10s
standards workspaces build + test / jcp-rs (jcp-conformance, jcp/jcp-rs, -p jcp-energy --features nvml, jcp-rs, linux) (pull_request) Successful in 1m47s
standards workspaces build + test / eoc-rs (eoc/eoc-rs, -p eoc-meter --features cuda, eoc-rs, linux) (pull_request) Successful in 2m8s
standards workspaces build + test / joule-ui-rs (joule-ui/joule-ui-rs, joule-ui-rs, linux) (pull_request) Successful in 1m10s
standards workspaces build + test / joulehook-rs (joulehook/joulehook-rs, joulehook-rs, linux) (pull_request) Successful in 1m11s
standards workspaces build + test / proof-rs (proof-conformance, proof/proof-rs, proof-rs, linux, true) (pull_request) Successful in 1m31s
standards workspaces build + test / sandbox-rs (sandbox-conformance, sandbox/sandbox-rs, sandbox-rs, linux) (pull_request) Successful in 2m26s
standards workspaces build + test / sense-rs (sense/sense-rs, sense-rs, linux) (pull_request) Successful in 1m12s
standards workspaces build + test / smart-byte-rs (smart-byte/smart-byte-rs, smart-byte-rs, linux) (pull_request) Successful in 4m11s
WAI conformance / quantum core and corpus under wasm32-wasip2 (wasmtime) (pull_request) Successful in 2m8s
WAI conformance / v2 vocabulary · manifests validate as stated (pull_request) Successful in 15s
WAI conformance / cargo-class corpora · linux (pull_request) Successful in 9m30s
WAI conformance / delivery telemetry · CMCD and CMSD against an independent library (pull_request) Successful in 9s
WAI conformance / cross-arch byte-equality · linux (pull_request) Successful in 27s
WAI conformance / C2PA manifest emission · signed, read back, validated (pull_request) Successful in 50s
WAI energy receipts / energy receipts · linux (pull_request) Successful in 2m6s
WAI JPEG-AI whole decode (pinned inputs, required) / fetch pinned JPEG-AI inputs → whole decode + pixel hash, required (pull_request) Successful in 1m25s
WAI neural sink gates / model-free refusals of the neural sink (pull_request) Successful in 1m13s
wai-quantum CUDA member / member · CUDA absent (linux) (pull_request) Successful in 21s
wai-quantum dataflow member / member · dataflow device, simulated (pci 1e52:b140) (pull_request) Successful in 2m6s
wai-quantum dataflow member / member · dataflow device, simulated (pci 1e52:401e) (pull_request) Successful in 1m27s
wai-quantum signal processor / processor and member · signal processor, emulated (pull_request) Failing after 2m46s
wai-quantum FPGA member / member · FPGA simulation absent (linux) (pull_request) Successful in 18s
wai-quantum neural-processor member / member · neural processor absent (linux) (pull_request) Successful in 17s
wai-quantum OpenCL member / member · OpenCL absent (linux) (pull_request) Successful in 19s
WAI conformance / independent verifiers · claims, JWP, key discovery and integer payloads (Python) (pull_request) Successful in 17m2s
wai-quantum-qpu / clients against their contracts (linux) (pull_request) Successful in 20s
wai-quantum matrix-extension member / member · matrix extension, emulated (aarch64 Linux) (pull_request) Successful in 35s
wai-quantum CPU vector units / member · vector unit, rvv 1024-bit (riscv64, emulated) (pull_request) Successful in 33s
wai-quantum CPU vector units / member · vector unit, sve 128-bit (aarch64, emulated) (pull_request) Successful in 28s
wai-quantum CPU vector units / member · vector unit, rvv 128-bit (riscv64, emulated) (pull_request) Successful in 36s
wai-quantum CPU vector units / member · vector unit, sve 2048-bit (aarch64, emulated) (pull_request) Successful in 15s
wai-quantum CPU vector units / member · vector unit, avx2 (x86_64 silicon) (pull_request) Successful in 18s
wai-quantum CPU vector units / member · vector unit, sve 512-bit (aarch64, emulated) (pull_request) Successful in 19s
wai-quantum WebGPU member / member · software Vulkan (linux) (pull_request) Successful in 2m12s
wai-quantum WebGPU member / shader checks · browser build · wasip2 inertness · MSRV (pull_request) Successful in 3m11s
wai-web wasm32 / wai-web wasm32 build · corpus, menu and writers (pull_request) Successful in 3m20s
WAI mbt2018_mean integer decode (regenerated vectors) / regenerate mbt2018_mean integer vectors → Rust decode, required (pull_request) Successful in 5m21s
wai-pack / wai-pack · linux (pull_request) Successful in 1m32s
wai-pack / wai-pack · the floor through a media prober (pull_request) Successful in 21s
wai-pack / wai-pack · dependency licences (pull_request) Successful in 1m14s
wai-pack / wai-pack · independent verifier (Python) (pull_request) Successful in 4m8s
wai-web reach builds / wai-web reach builds · the package of record, every output as recorded (pull_request) Successful in 2m54s
wai-web reach builds / wai-web reach builds · this tree's wai-web, every rung on its engine line (pull_request) Successful in 5m27s
scripts: no pipe into grep -q under pipefail
`printf ... | grep -q` under `set -o pipefail` reports no match when grep
exits at its first match while printf is still writing: printf dies of
SIGPIPE and the pipeline's status is 141. The tests-in-CI self-test failed
that way on the repository checks job (main shows the same job red on one
commit and green on its neighbours), and check-lockfiles.sh classifies
cargo's message the same way, so a timing accident could misread it.
Each now reads a here-string, with nothing to break.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-15 01:52:03 -04:00

65 lines
3.3 KiB
Shell
Executable file

#!/usr/bin/env bash
#
# check-tests-in-ci-selftest.sh — check-tests-in-ci.py can fail.
#
# A check that cannot fail is decoration. This builds a scratch tree shaped like the
# repository (one workflow, one crate with a plain test, a feature-gated test and a
# test listed as not run) and asserts that the check passes it, and fails each way the
# property can break, saying which.
set -uo pipefail
here=$(cd "$(dirname "$0")" && pwd)
check="$here/check-tests-in-ci.py"
tmp=$(mktemp -d)
trap 'rm -rf "$tmp"' EXIT
C="$tmp/wai/wai-rs"
mk() {
rm -rf "$tmp/.github" "$tmp/wai"
mkdir -p "$tmp/.github/workflows" "$C/tests"
printf 'jobs:\n t:\n steps:\n - run: cargo test --features f --test alpha --test gated\n' > "$tmp/.github/workflows/w.yml"
printf '[package]\nname = "x"\n\n[features]\nf = []\ng = []\n\n[[test]]\nname = "gated"\npath = "tests/gated.rs"\nrequired-features = ["f"]\n' > "$C/Cargo.toml"
printf '#[test]\nfn a() {}\n' > "$C/tests/alpha.rs"
printf '#![cfg(feature = "f")]\n#[test]\nfn g() {}\n' > "$C/tests/gated.rs"
printf '#[test]\nfn l() {}\n' > "$C/tests/local.rs"
printf '# name, then why no job runs it\nlocal needs a device no runner has\n' > "$C/tests/NOT-IN-CI.txt"
}
fails=0
expect() { # expect <pass|fail> <what> [text the output must hold]
local want=$1 what=$2 needle=${3:-} out rc
out=$(python3 -I "$check" --root "$tmp" 2>&1); rc=$?
if [ "$want" = pass ] && [ $rc -ne 0 ]; then echo "FAIL $what: the check failed"; printf '%s\n' "$out" | sed 's/^/ /'; fails=$((fails+1)); return; fi
if [ "$want" = fail ] && [ $rc -eq 0 ]; then echo "FAIL $what: the check passed"; fails=$((fails+1)); return; fi
if [ -n "$needle" ] && ! grep -q -- "$needle" <<<"$out"; then echo "FAIL $what: the output does not say '$needle'"; printf '%s\n' "$out" | sed 's/^/ /'; fails=$((fails+1)); return; fi
echo "ok $what"
}
mk; expect pass "a tree where every test is run or listed passes"
mk; printf '#[test]\nfn b() {}\n' > "$C/tests/beta.rs"
expect fail "a test file no step names and nothing lists" "beta.rs: no workflow step names it"
mk; printf '[package]\nname = "x"\n\n[features]\nf = []\n' > "$C/Cargo.toml"
expect fail "a feature-gated test with no required-features" "runs it empty"
mk; sed -i.bak 's/required-features = \["f"\]/required-features = ["g"]/' "$C/Cargo.toml"
expect fail "required-features that are not the file's features" "is gated on"
mk; printf '#![cfg(any(feature = "f", feature = "g"))]\n#[test]\nfn g() {}\n' > "$C/tests/gated.rs"
expect fail "a gate the check cannot read" "cannot tell what it needs"
mk; printf 'alpha no reason at all, a step runs it\n' >> "$C/tests/NOT-IN-CI.txt"
expect fail "a test listed as not run that a step names" "remove the line"
mk; printf 'ghost it was deleted\n' >> "$C/tests/NOT-IN-CI.txt"
expect fail "a listed name that is no test file" "ghost is not a test file"
mk; printf 'local\n' > "$C/tests/NOT-IN-CI.txt"
expect fail "a listed test with no reason" "not .name reason."
mk; printf '\n[[test]]\nname = "gone"\npath = "tests/gone.rs"\n' >> "$C/Cargo.toml"
expect fail "a [[test]] entry for a file that does not exist" "which does not exist"
if [ $fails -ne 0 ]; then echo "check-tests-in-ci-selftest: $fails failure(s)"; exit 1; fi
echo "check-tests-in-ci-selftest: the check passes a covered tree and fails each uncovered one."