Repository navigation
Simplify the browser test suite - #667
Conversation
leaf-agent
left a comment
There was a problem hiding this comment.
The suite simplification itself reads well — the batched corpus classification is faithful to the per-element version it replaces (it also tightens aria-disabled to the ancestor walk and takes one DOM snapshot instead of re-querying by index), the holding() substitutions turn a zero-duration yield into a stated condition, and the browser fixture teardown is safe against the serve teardown that now precedes it, since LeafHTTPServer.shutdown sets stopping and server_close shuts down the read half of every open connection. Four things the diff leaves inconsistent:
publish-site does not cover everything the website gate covered on a main push. scripts/site.py does from page_fixtures import prepare_page, read_fixture, but scripts/page_fixtures.py is not in publish-site.yaml's paths:, which otherwise enumerates site.py's script-level imports (scripts/example_data.py, scripts/example_assets.py, scripts/preview.py). scripts/verify_site.py and scripts/verify-site-local.sh — the gate's own driver — are missing from it too. wt merge squash-merges straight to main, so for those files the ci main-push run was the only place the site build and the Chrome measurement ever ran; after this change neither workflow fires. Adding those three paths to publish-site.yaml closes it.
pyproject.toml still declares playwright>=1.49, which the diff makes false. Locator.filter(visible=True) in test_the_composed_corpus_declares_every_control_row_archetype needs 1.51 — I checked the 1.49.0 and 1.50.0 wheels and filter() there accepts only has_text, has_not_text, has, has_not, so a resolution at the floor raises TypeError. CLAUDE.md's "The install runs this tree" states the floor is "the lowest version the suite passes on"; playwright>=1.51 restores that.
examples/CLAUDE.md still routes readers to the deleted module: "Every place that builds a page directory out of an example lays the log in: scripts/preview.py, publish_pages, test_page_fixtures_pass_check, and serve in tests/render_support.py." serve is in tests/render_harness.py now.
Root CLAUDE.md's TypeScript paragraph names the job that no longer runs it. The paragraph above it is updated, but this one still reads "So a TypeScript change carries no gate until ci's test job runs it, which on a wt merge is after main has already moved" — on a push that job now skips typecheck and npm test, and publish-site is where they run.
All four are outside the diff's hunks. Happy to push a commit with them if you want it.
The browser suite had accumulated a compatibility facade, repeated cleanup, scheduler-yield waits, and one corpus audit that crossed the Playwright boundary once per control and archetype. This removes those parallel conventions and makes the existing owners explicit.
render_support.py; tests now import helpers from the harness or owning case library directly.page.close()/context.close()calls while retaining lifecycle-significant closes.holding()helper.cifor pull requests only; relevant main pushes run it inpublish-sitebefore deployment, whose path filter now covers every build and verification script it executes.Validation: all pre-commit hooks; 2,575-test complete suite; 1,043-test ordinary suite after merging current main; focused corpus, route-holding, browser-cleanup, and overlapping-main cases.