Skip to content

test: remove redundant unit tests (subsumed coverage + linter-enforced conventions)#587

Open
TomHennen wants to merge 4 commits into
mainfrom
claude/trim-redundant-unit-tests
Open

test: remove redundant unit tests (subsumed coverage + linter-enforced conventions)#587
TomHennen wants to merge 4 commits into
mainfrom
claude/trim-redundant-unit-tests

Conversation

@TomHennen

@TomHennen TomHennen commented Jun 21, 2026

Copy link
Copy Markdown
Owner

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.

⚠️ Merge as a merge commit, not a squash. Several of the removed tests live inside SHA-pinned composite-action directories, so this PR converges its own self-ref pins in-PR (the two chore: converge self-ref pins commits). Squashing would re-orphan the intermediate nested pin (verify_release → verify). After merge, a routine tools/bump_action_pins.sh <main-sha> rolls the pins to the main SHA. See docs/e2e_testing.md.

Round 1 — subsumed by stronger existing coverage (14 tests)

  • wrangle-shell-lint (6): per-rule "good.sh is not flagged" wrappers — the clean script: no violations reported test already asserts empty output, which excludes every rule id.
  • wrangle-workflow-lint (1): the WWL003 good.yml exemption check — good.yml carries a justified continue-on-error, so the clean-workflow test exercises that path.
  • verify (2): bnd-push-args shape (owned by the sign_metadata suite) and sourceable and callable (the arms are covered by the direct-exec tests; the sourced path by run_verify's fail-closed test).
  • stop_commands_guard (1): preamble grep — enforced mechanically by WSL001/WSL002.
  • log_findings (1): "exactly N lines" — the N×M over-emission path is guarded by the multi-location test.
  • check_results (1): explicit :fail marker — default ≡ :fail is established by the policy-parsing tests.
  • attest_{metadata_oci,provenance} (2): missing-metadata-root fail-closed — the guard is the first statement in the shared function and is covered centrally; each wrapper's wiring is proven by its real-engine happy-path test.

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.

  • WSL002 set -f preamble (11): the go ^set -f greps + container/npm/python copies.
  • WSL001 set -euo pipefail (2): the integration dispatch.sh / push_showcase_tag.sh preamble greps.
  • WWL002 no ${{ inputs.* }} in a run: body (3): the go/npm/python composite-action interpolation scans.

Deliberately kept (looked redundant, verified not)

  • Per-build-type path-rejection tests — wiring/integration tests proving each script routes its input through validate_path.sh; the central test only covers the lib in isolation.
  • Real-engine attestation end-to-end tests — they drive the real wrangle-attest binary; the central equivalents use stubs (the repo's unit/integration boundary).
  • "printf not echo" greps — forbid all echo, broader than WSL003's variable-only rule.
  • env-passthrough plumbing greps — verify a specific input is wired through env:, which no linter checks.

🤖 Generated with Claude Code

@TomHennen TomHennen temporarily deployed to integration-test June 21, 2026 22:06 — with GitHub Actions Inactive
TomHennen and others added 4 commits June 21, 2026 18:11
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>
@TomHennen TomHennen force-pushed the claude/trim-redundant-unit-tests branch from 01ad61d to 6c0caf0 Compare June 21, 2026 22:15
@TomHennen TomHennen temporarily deployed to integration-test June 21, 2026 22:15 — with GitHub Actions Inactive
@TomHennen TomHennen added this to the v0.4.0 milestone Jun 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant