Repository navigation
test: cut the e2e suite to what needs a browser, and serve it production builds - #1930
Merged
joshunrau merged 9 commits intoNov 19, 2026
Merged
Conversation
Every password set or changed asks the Have I Been Pwned API about it. PASSWORD_BREACH_CHECK_ENABLED (default true) turns that off, so the e2e suite and the api integration suites no longer depend on an outside server, and an air-gapped deployment need not wait on one either. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The gateway, web and playground dev servers held about 2.5 GB between them (the gateway alone 1.25 GB, running Vite in-process) and served every module unbundled. The suite now starts the gateway's production server and `vite preview` of the web and playground builds, which turbo builds before it. On two workers a run fell from 7.9 to 4.7 minutes and its typical footprint from 5.4 to 3.6 GB. Firefox ran only the @smoke tests and is dropped, along with its CI install. The API's gateway sync interval is now a constant the suite owns (2 s) and passes to the API, instead of the 10 s a deployment uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Most end-to-end tests asserted a rule a unit or API test already pinned, or one that a component or a single route owns. Each was deleted only after its covering test was read, and where that test fell short the missing assertion was added first. Row scoping, which mocked models cannot show, moved to new suites in apps/api/test that run against the real database; tests that walked one flow were merged to share their setup, and preconditions are seeded over the API instead of the UI. The suite goes from 399 tests to 98 and, on two workers, from 4.7 to 1.3 minutes. Fixed sleeps are gone: the gateway tests poll the API for the synchronized state, the slow-import and malformed-submission tests are covered by unit tests, and the JSPsych example runs with its timing patched. Page-object members and ApiClient methods nothing uses any more are removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…suite Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pnpm test:coverage and pnpm test:e2e now wait for a lock held in the git common directory, which every worktree shares. Two sessions running `pnpm check` at once exhausted an 18 GB machine's memory, and two e2e runs collide on the same ports regardless. The waiting run names the one it waits on, and a lock whose holder has exited is taken over. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…should The series datahub summary is now checked against a foreign record that carries a series id, without which the summary returned nothing whether or not it was scoped. The archived group is created before the others, so it is the first of the user's groups as the test assumes. The gateway landing test no longer retries for a language toggle no spec makes any more, and the authorization suite's two session helpers share one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ed port The suite freed a probed port and assumed it stayed free until it sent mail. Another process started listening on it in between, and delivery failed on authentication instead of being refused. Port 1 lies outside the range the OS assigns to other sockets. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`//#lint:root` type-checks apps/outreach, whose `astro:content` types live in the git-ignored `.astro/` that only `astro check` (outreach's own `lint`, running alongside) wrote. On a fresh checkout such as CI's, the root type-check could run first and read every collection as `any`. `@opendatacapture/outreach#gen:types` runs `astro sync`, caches `.astro/`, and `//#generated` now depends on it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
pnpm test:e2eran 419 tests against four dev servers, took 7 minutes on two local workers (about 15 on CI's one), and with a second session'spnpm checkalongside it pushed an 18 GB machine into swap until it crashed. It now runs 98 tests against production builds in about 1.3 minutes locally, and the behaviour the removed tests proved is pinned in unit and API tests instead.Changes
vite previewof the web and playground builds, whichpnpm test:e2ebuilds first through turbo. The API still runspnpm dev:test. A bareplaywright testortest:devserves whatever was last built.PASSWORD_BREACH_CHECK_ENABLED(defaulttrue). Whenfalse, setting a password no longer asks the Have I Been Pwned API. The e2e API server and the api vitest project set it tofalse, so neither depends on an outside server.docker-compose.yamlforwards it..env.apps/api'sdev:testnow loads.envwithenv-cmd --no-override, so a variable already set in its environment wins over.env.pnpm test:coverageandpnpm test:e2ewait for a lock in the git common directory, shared by every worktree. A second run on the machine waits and names the run it is waiting on. A lock whose holder has exited is taken over.apps/api/test/suites/(07–09) that run against the real database.pnpm lintgeneratesapps/outreach's Astro content types (gen:types,astro sync) before the root type-check reads them. On a fresh checkout such as CI's, the type-check could run first and read everyastro:contentimport asany.Decisions
manage.tsx), and the e2e instance is a demo because demo setup seeds its instruments.09-group-access.suite.ts, and the e2e now asserts the read-only form instead.test:coverageandtest:e2e, notpnpm testorpnpm checkas a whole. Plainvitestis often left in watch mode, and lint is light. CI's single job takes the lock uncontended.Risks
pnpm test:coveragein an interactive terminal starts vitest in watch mode, which holds the lock until it is closed. Another session'spnpm checkwaits for it.PASSWORD_BREACH_CHECK_ENABLED=falsestops refusing breached passwords. Unset, nothing changes.Notes
pnpm checkthen showed07-mail-delivery.suite.tswas racy: it freed a probed port that another process could start listening on, so it now uses port 1. That second run, over that one file, returned no findings.astro:contenterrors; with it, the same run passes.summarizeRecordsmakes all three summary cases fail, includingby-series, which passed with or without scoping before the fix.Adversarial review
Reviewed at commit d29ce83. pnpm check: green.
Findings
by-seriessummary case passes whether or not the route is scoped, because no record in the suite carries aseriesInstrumentId— write a series-keyed record in the foreign group and keep the[]assertiontoPassretry with an admin-settings language toggle that this change deleted — rewrite it with the reason that still holds, or drop the retrycreateRecordrepeatscreateSubject's session request — share onecreateSessionhelperFixed
createSessionhelper;createSubjectandcreateRecordbuild on it.Attestation
I, Claude Opus 5.5, attest that the review block above reports the adversarial review as it ran on the commit named, with every finding it returned.
🤖 Generated with Claude Code