@@ -45,17 +45,37 @@ npm run test:ui # open browser and test suite, run tests at your leisure
4545Traces are captured ` on-first-retry ` (see [ ` playwright.config.ts ` ] ( playwright.config.ts ) ),
4646so a failed test on CI leaves a trace you can open with ` npx playwright show-trace ` .
4747
48- ## How they work
48+ ## Running the stack without the tests
4949
50- Playwright's ` globalSetup ` ( [ ` global-setup.ts ` ] ( global-setup.ts ) ) uses
51- [ Testcontainers ] ( https://testcontainers.com/ ) to stand up everything the tests need:
50+ ` npm run dev:e2e ` boots exactly the same stack the tests use, prints the service URLs and
51+ holds it open until you press Ctrl-C, which tears it all down.
5252
53- 1 . a shared Docker network;
54- 2 . ** Elasticsearch** and ** LocalStack** (the backing infrastructure);
55- 3 . the ** CloudFormation core stack** (` dev/cloudformation/grid-dev-core.yml ` ) and seeded
56- buckets, provisioned into LocalStack;
57- 4 . per-service config, generated by ` dev/script/generate-config/service-config.js ` ;
58- 5 . the Grid Docker image (either ` grid-e2e-ci ` or ` grid-e2e-dev ` ) — a single container running Grid's Play services.
53+ ``` bash
54+ npm run dev:e2e # uses your local dev-nginx for the https://*.media.<domain> domains
55+ GRID_PROXY=true npm run dev:e2e # no dev-nginx? start the bundled Caddy proxy on :443 instead
56+ ```
57+
58+ The stack binds fixed host ports, so two stacks cannot run
59+ at once. Starting a second one fails immediately rather than timing out.
60+
61+ ### Running the tests against a stack you already started
62+
63+ The test commands reuse a running stack instead of booting their own, which turns a
64+ multi-minute boot into a couple of seconds. Leave ` npm run dev:e2e ` running in one
65+ terminal, then use ` npm test ` , ` npm run test:ui ` or any of the others as normal — they
66+ attach automatically and leave the stack running when they finish.
67+
68+ If only some services are up (usually because the stack is still booting), the run stops
69+ straight away and names the ports it is waiting on.
70+
71+ | Variable | Effect |
72+ | --- | --- |
73+ | ` GRID_RESEED=true ` | Reload the Elasticsearch fixtures into the reused stack. |
74+
75+ ** Watch out for stale provisioning.** A reused stack picks up Scala changes (the repo is
76+ bind-mounted and services run under ` sbt run ` ), but * not* changes to anything applied at
77+ boot: generated service config, the CloudFormation template, bucket contents, permissions
78+ or the Elasticsearch fixtures. After changing any of those, restart ` dev:e2e ` .
5979
60- Elasticsearch is then seeded with image fixtures, and the resolved Kahuna base URL is
61- exposed to the tests. ` globalTeardown ` stops everything and cleans up .
80+ Reuse also means state carries over between runs. The current suite is read-only, so this
81+ is harmless today, but a test that uploads or edits an image will want a fresh stack .
0 commit comments