Skip to content

test: name tests by the tier they actually occupy, and guard it - #340

Merged
cvince merged 1 commit into
feat/portabilityfrom
claude/test-tier-naming
Aug 28, 2026
Merged

test: name tests by the tier they actually occupy, and guard it#340
cvince merged 1 commit into
feat/portabilityfrom
claude/test-tier-naming

Conversation

@cvince

@cvince cvince commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Nine files were named *.e2e.test.ts and ran on every commit inside run-tests.sh. None requires a live system — they spawn the real built CLI against fake services. Good tests, wrong label.

The cost is not cosmetic: "the E2E tests pass" and "the E2E tests ran" meant different things depending on who said them. The genuinely live suite is in the monorepo (bun run tests/e2e/e2e.ts) and runs separately, so a green run-tests.sh could be offered — honestly and wrongly — as evidence that an end-to-end path had been exercised against staging.

The taxonomy

suffix meaning
*.test.ts unit — nothing spawned
*.int.test.ts real code paths, real spawned CLI, faked boundaries
*.browser.test.ts as above, plus a real headless browser over CDP
*.e2e.* reserved for live systems; none belong in this package

One file is not what the inventory said

browserFlow was reported as touching nothing live, because a search for playwright/chromium came back empty. It drives a real headless Chrome over CDPfindHeadlessShell, CdpSession, chrome-headless-shell. Calling it .int. would have swapped one inaccurate label for another.

It gets its own .browser. tier because it needs a binary that is neither in this repo nor in bun install, and a run that silently skipped it would otherwise look identical to one that passed it.

The guard matters more than the rename

A test that fails if any .e2e. file exists here, naming the offender and where its tier is actually run. It lives in the suite rather than in run-tests.sh, because anyone can type bun test and CI can grow a second entrypoint.

Proven able to fail: adding a stub zzTempDrift.e2e.test.ts turns it red; removing it returns green. It also carries its own control — an empty offenders list is both the passing state and what a broken directory walk produces, so the scan asserts it can see files at all.

Suite: 1851 pass, 0 fail.

Nine files were named `*.e2e.test.ts` and ran on every commit inside
run-tests.sh. None of them requires a live system: they spawn the real built
CLI against fake services. Good tests, wrong label.

The cost was not cosmetic. "the E2E tests pass" and "the E2E tests ran" meant
different things depending on who said them — the genuinely live suite is in
the monorepo (`bun run tests/e2e/e2e.ts`) and runs separately. A green
run-tests.sh could be offered, honestly and wrongly, as evidence that an
end-to-end path had been exercised against staging.

  *.test.ts          unit — nothing spawned
  *.int.test.ts      real code paths, real spawned CLI, faked boundaries
  *.browser.test.ts  as above, plus a real headless browser over CDP
  *.e2e.*            RESERVED for live systems; none belong in this package

ONE FILE IS NOT WHAT THE INVENTORY SAID. browserFlow was reported as touching
nothing live because a search for `playwright`/`chromium` came back empty. It
drives a REAL headless Chrome over CDP — `findHeadlessShell`, `CdpSession`,
chrome-headless-shell — so calling it `.int.` would have replaced one
inaccurate label with another. It gets `.browser.` because it needs a binary
that is not in this repo and not in `bun install`, and a run that silently
skipped it would otherwise look identical to one that passed it.

The guard is the part that matters more than the rename: a test that fails if
any `.e2e.` file exists in this package, with a message naming the offender
and where its tier is actually run. It lives in the test suite rather than in
run-tests.sh because anyone can type `bun test` and CI can grow a second
entrypoint.

Proven able to fail: adding a stub `zzTempDrift.e2e.test.ts` turns it red;
removing it returns green. It also carries its own control — an empty
offenders list is the passing state AND the result a broken directory walk
produces, so the scan asserts it can see files at all.

Suite: 1851 pass, 0 fail.
@cvince
cvince merged commit d135f7a into feat/portability Aug 28, 2026
2 checks passed
@cvince
cvince deleted the claude/test-tier-naming branch August 28, 2026 21:09
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