Public: anyone can read this; the crew can change it.

Release-gate flakes: every test stands alone and owns its fixtures (held 0.7.144 and 0.7.146) #2226

Parked opened this in answer to
Closed without merging

test/looks.test.ts no longer depends on test order. A nightly "alone" lane now catches any gate test that only passes after another one has run. bun test test/looks.test.ts -t "made private after its pictures" passes on its own.

Notes

stopped parked by the crew deploy 5b28243

opened this

test/looks.test.ts no longer depends on test order. A nightly "alone" lane now catches any gate test that only passes after another one has run. bun test test/looks.test.ts -t "made private after its pictures" passes on its own.

Fix (test/looks.test.ts). Before this change, 7 of the file's 13 tests failed when run alone, and the file was red in every --randomize run. The existing hunt counts a file that is red every time as "broken" and never files an issue, so this one was never reported. Each test now makes what it reads:

  • Shared setup made on first use: production() waits for the deploy newApp started to be pictured. greeting() makes a pull pictured at two heads.
  • Its own pictures: tests write look rows and files with seedLook.
  • Its own pulls and apps: the failed-picture and closed-pull tests open their own pulls. #845 creates its own public app, keepsake, instead of reading gallery's phone picture.
  • Clean-up: tests that drop, fail or rewrite production's pictures put them back through keepingProduction.
  • Call counts: checks now count the calls for one commit of one environment (callsOf), not the global total.

Every test passed alone, and in five random orders. The one exception is the real-Chromium capture: it fails in my sandbox (Chromium can't open a socket here), and the forge's check runs it.

Order-dependence lane (scripts/flake-hunt.ts alone, scripts/flake.ts).

  • What it runs: each gate file once in its own order, once in random order, and every test by itself. Each test is selected with -t and its exact name, read from bun test --reporter=junit. Skipped and todo tests are left out.
  • What it files: a file that is green in order but has a test red alone or in random order gets an Order-dependent: test/x.test.ts issue. The issue names each failing test with the command that reproduces it. Such files are not quarantined: the gate runs them in order, where they pass, so the issue is the record.
  • Schedule: it is a new alone job in flake-hunt.yml, split into 20 slices. Each slice starts no new file after 22 minutes and logs the files it didn't reach. The file order changes each night, so those are reached on a later night.
  • Checked against the real failure: run on the old looks.test.ts, the lane flags exactly the 7 tests that fail alone; the new file passes.

Host files and browsers. missing() in test/helpers/tools.ts now prints a reason worded for a missing host file (/proc/…) as well as a missing tool. CLAUDE.md and README.md now say every test must pass alone and must declare what the machine may lack.

Not done:

  • No lint for find(...)! across the test suite.
  • Running every gate test alone every night is expensive, so coverage rotates across nights rather than finishing each night.
  • The real-capture test still skips only when Chromium is absent, not when it is installed but cannot run. That would mean probing a browser launch at load time.

Where to look:

  • The once / seedLook / keepingProduction helpers near the top of looks.test.ts.
  • testNames and orderIssueFor in scripts/flake.ts.
  • The order dependence (#2219) block in test/flake.test.ts, whose end-to-end case runs alone on a file where the second test reads what the first one left.

To try it: bun scripts/flake-hunt.ts alone test/looks.test.ts test/flake.test.ts

🤖 Generated with Claude Code

Closes #2219

commented

Parked by the crew: the check failed ("the forge's health in the terminal > a site admin sees a degraded cause's sentence; anyone else sees nothing") and the decider saw no point in another try

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs