test: remove redundant unit tests (subsumed coverage + linter-enforced conventions)#587
Open
TomHennen wants to merge 4 commits into
Open
test: remove redundant unit tests (subsumed coverage + linter-enforced conventions)#587TomHennen wants to merge 4 commits into
TomHennen wants to merge 4 commits into
Conversation
Drop 14 unit tests whose assertions are fully covered elsewhere, with no
loss of behavioral coverage:
- wrangle-shell-lint: six per-rule "good.sh is not flagged" checks; the
"clean script: no violations reported" test asserts empty output, which
already excludes every rule id.
- wrangle-workflow-lint: the WWL003 good.yml exemption check; good.yml
carries a justified continue-on-error, so the clean-workflow test
exercises the exemption path.
- run_verify: bnd-push-args shape (covered by the sign_metadata suite that
owns wrangle_bnd_push_args).
- validate_verify_inputs: "sourceable and callable" (the good/bad arms are
covered by the direct-exec tests; the sourced path is exercised by
run_verify's fail-closed test).
- stop_commands_guard: preamble grep (enforced by wrangle-shell-lint
WSL001/WSL002 over every repo script).
- log_findings: "exactly N lines" (the N×M over-emission path is guarded by
the multi-location test).
- check_results: explicit :fail marker (default==:fail is established by the
policy-parsing tests; the marker path is covered under the default policy).
- attest_{metadata_oci,provenance} sign_metadata: missing-metadata-root
fail-closed (the guard is the first statement in
wrangle_sign_and_assemble_bundles, covered centrally; each wrapper's
wiring is proven by its real-engine happy-path test).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
These tests grep a script/action source to assert a style property that a
custom linter now enforces over the whole tree in `make test` — mechanical
enforcement the test duplicates (CLAUDE.md: "Mechanical enforcement beats
prose").
WSL002 (set -f is the universal preamble's second line), over every tracked
*.sh the shell linter walks:
- build/actions/go: seven `^set -f` greps (validate_inputs/run_checks/
compute_hashes/compute_metadata/generate_summary + tools/syft generate_sbom)
- build/actions/container: validate_inputs.sh, resolve_cache.sh
- build/actions/npm, python: validate_path.sh (and python's validate_inputs.sh)
WSL001 (set -euo pipefail first), over the integration helper scripts:
- test/integration: dispatch.sh, push_showcase_tag.sh preamble greps
WWL002 (no ${{ inputs.* }} interpolation in a run: body), over every
composite action.yml the workflow linter walks:
- build/actions/go, npm, python: the run-block interpolation scans
Kept: the "printf not echo" greps (they forbid all echo, broader than
WSL003's variable-only rule) and bump_action_pins' set +f test (its
existence check is not a WSL007 property).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
01ad61d to
6c0caf0
Compare
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.
Removes 30 redundant unit tests (240 lines, deletions only) across two rounds of review. Every removal was individually verified; the full bats suite is green (
make bats: 0 failures). No production logic changed.Round 1 — subsumed by stronger existing coverage (14 tests)
clean script: no violations reportedtest already asserts empty output, which excludes every rule id.good.ymlexemption check —good.ymlcarries a justifiedcontinue-on-error, so the clean-workflow test exercises that path.bnd-push-argsshape (owned by the sign_metadata suite) andsourceable and callable(the arms are covered by the direct-exec tests; the sourced path by run_verify's fail-closed test).:failmarker —default ≡ :failis established by the policy-parsing tests.Round 2 — re-asserting linter-enforced conventions (16 tests)
Tests that grep a source file for a style property a custom linter now enforces over the whole tree in
make test(CLAUDE.md: "Mechanical enforcement beats prose"). The linters' own suites (untouched) verify the rules fire on bad fixtures, and both linters pass clean on the tree.set -fpreamble (11): the go^set -fgreps + container/npm/python copies.set -euo pipefail(2): the integrationdispatch.sh/push_showcase_tag.shpreamble greps.${{ inputs.* }}in arun:body (3): the go/npm/python composite-action interpolation scans.Deliberately kept (looked redundant, verified not)
validate_path.sh; the central test only covers the lib in isolation.wrangle-attestbinary; the central equivalents use stubs (the repo's unit/integration boundary).echo, broader than WSL003's variable-only rule.env:, which no linter checks.🤖 Generated with Claude Code