fix(deps): the end-to-end test framework ships in the production container #178

Stängd
öppnade 2026-08-02 16:07:23 +00:00 av supernaut · 0 kommentarer
Ägare

nightwatch is declared in dependencies rather than devDependencies. The Containerfile installs
production dependencies only — pnpm install --frozen-lockfile --prod at line 21 and
pnpm install --prod --frozen-lockfile at line 37 — so a WebDriver client and its whole closure is
installed into the image that serves the public site.

Nothing in src/ imports it. It is used by nightwatch.conf.js and scripts/e2e.mjs, both of which
run only on a developer machine, via the pre-push hook.

Roughly 24 MB of the runtime image is test tooling: selenium-webdriver (~18 MB), nightwatch
(~3.3 MB), axe-core (~2.9 MB), plus transitive dependencies. Beyond the size, a browser-automation
client with no runtime purpose is avoidable attack surface in a public-facing container.

This is independent of any test-framework decision — the same misplacement would ship whichever
framework is used, and it should be corrected before that work rather than folded into it.

What to do

Move nightwatch to devDependencies and refresh the lockfile. Check geckodriver and anything
else test-only at the same time.

Done when

  • nightwatch is in devDependencies
  • A --prod install tree contains no selenium-webdriver and no nightwatch
  • The end-to-end suite still runs locally
  • pnpm lint, pnpm check and pnpm test pass
`nightwatch` is declared in `dependencies` rather than `devDependencies`. The Containerfile installs production dependencies only — `pnpm install --frozen-lockfile --prod` at line 21 and `pnpm install --prod --frozen-lockfile` at line 37 — so a WebDriver client and its whole closure is installed into the image that serves the public site. Nothing in `src/` imports it. It is used by `nightwatch.conf.js` and `scripts/e2e.mjs`, both of which run only on a developer machine, via the `pre-push` hook. Roughly 24 MB of the runtime image is test tooling: `selenium-webdriver` (~18 MB), `nightwatch` (~3.3 MB), `axe-core` (~2.9 MB), plus transitive dependencies. Beyond the size, a browser-automation client with no runtime purpose is avoidable attack surface in a public-facing container. This is independent of any test-framework decision — the same misplacement would ship whichever framework is used, and it should be corrected before that work rather than folded into it. ## What to do Move `nightwatch` to `devDependencies` and refresh the lockfile. Check `geckodriver` and anything else test-only at the same time. ## Done when - [ ] `nightwatch` is in `devDependencies` - [ ] A `--prod` install tree contains no `selenium-webdriver` and no `nightwatch` - [ ] The end-to-end suite still runs locally - [ ] `pnpm lint`, `pnpm check` and `pnpm test` pass
supernaut lade till detta till projektet Bitborg Web 2026-08-02 16:10:17 +00:00
Logga in för att delta i denna konversation.
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Förfallodatumet är ogiltigt eller utanför gränserna. Använd formatet "åååå-mm-dd".

Inget förfallodatum satt.

Beroenden

Inga beroenden satta

Referens
bitborg/bitborg-web#178
Ingen beskrivning angiven.