Skip to content

ci: unit and race runs filter no test names - #126

Merged
bketelsen merged 5 commits into
mainfrom
irulan/unit-runs-no-name-filter
Nov 4, 2026
Merged

bketelsen merged 5 commits into
mainfrom
irulan/unit-runs-no-name-filter

Conversation

@frostyard-machines

@frostyard-machines frostyard-machines commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

What this changes

make test, make ci and CI's race job ran go test -run '^Test[^I]' (core ADR-0022) to skip integration tests named TestI…. But -run also selects fuzz targets and examples, so the filter silently skipped the seed corpora of FuzzParseScope (api/scope_test.go) and FuzzSanitize (internal/render/sanitize_test.go), and would skip any TestI… unit test or Example: checks that could never fail. Found by the T776a sweep. Core ADR-0038 (which supersedes ADR-0022) already limits the name filter to chairlift.

  • Makefile (test, ci) and .github/workflows/ci.yml:61: no name filter. Every integration test already sits in a file with //go:build integration, so unit runs do not compile it. Integration targets keep their -tags integration -run ….
  • Guard: internal/repocheck/testfilter_test.go replaces testnames_test.go (the obsolete TestI reservation). TestUnitRunsFilterNoTestNames reads the Makefile (continuation lines joined) and every workflow's parsed run: values, splits them into commands (outside quotes; # comments dropped), and fails on any go test run without the integration tag (the last -tags wins) that has -run or -skip. A run counts only at a command's start (after VAR=value and $(XVFB)-style wrappers), and only scripts that run are searched again ($(IN_NSL) '…', sh -lc '…'), so echo 'go test …' is text. It fails if it finds no go test run at all. Table tests cover the matcher (old lines, compound commands, $(GO) test, tag forms, comments, echo, wrappers) and the run counter.
  • Docs: ADR-0035 (supersedes ADR-0009's filter in part; ADR-0009 gets only its status line and a back-link), docs/README.md, docs/org-adrs.md, AGENTS.md, docs/tasks/EXECUTOR.md.
  • Separate commit: TestFileRefusesReadableFile wrote its file with 0o644 through os.WriteFile, which applies the umask. Under umask 077 the file was 0600 and the test failed locally (CI's umask 022 hid it). It now sets the mode with os.Chmod.

How we know it works

  • Revert test: with the old Makefile and ci.yml restored (git stash), the guard fails:
    Makefile:47: a unit run filters test names; every hermetic test must run (frostyard/core ADR-0038)
    Makefile:110: a unit run filters test names; ...
    .github/workflows/ci.yml:61: a unit run filters test names; ...
    
    With this change it passes.
  • go test -v -run '^Test[^I]' ./api/ ./internal/render/ runs 0 fuzz targets; go test -v ./api/ ./internal/render/ runs FuzzParseScope and FuzzSanitize with their seeds, and they pass.
  • TestFileRefusesReadableFile fails on main under umask 077 (Get on a 0644 file = <nil>) and passes with the fix, under 077 and 022.
  • make check passes (umask 077).

What it must not break

  • Required-check names: no job is renamed (Race detector keeps its name; only its run: line changes).
  • Integration targets (make vault-it, sync-sim, m3-evidence, m4-evidence, porter-evidence, …) keep their tags and -run selectors.
  • The race job's time: it now also runs 2 seed corpora, a few milliseconds.

Coder: github-copilot/mai-code-2-flash; the umask fix and review edits by Irulan.

Cross-review

Reviewer openai/gpt-6.1-sol; coder github-copilot/mai-code-2-flash, with the matcher's later rewrites by Irulan (Claude). 1 review + 3 re-reviews (the full budget):

  • Review at fe297c0: Not ready. A1 (multi-line workflow run: | blocks missed), A2 (commands not analysed separately; $(GO) test; tag forms), A3 (missing ADR-0035 back-links). All accepted and fixed.
  • Re-review 1 at be64f67: A1, A3 resolved; A-R1 (an inline comment could exempt a run; echo go test counted), A-R2 (-tags="a b"). Accepted and fixed.
  • Re-review 2 at f3f83e9: A-R2 resolved; A-R3 (quoted echo text searched as a script). Accepted and fixed.
  • Re-review 3 at ee9309c: Ready, Blocking: none. Limit noted by the reviewer: the matcher supports the stated command forms; it is not a complete shell interpreter.

@frostyard-machines frostyard-machines added the ready-for-human Reviewed, CI green: ready for Brian to review and merge label Nov 4, 2026
@bketelsen
bketelsen merged commit 4772af5 into main Nov 4, 2026
9 checks passed
@bketelsen
bketelsen deleted the irulan/unit-runs-no-name-filter branch November 4, 2026 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready-for-human Reviewed, CI green: ready for Brian to review and merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants