Repository navigation
Description
Summary
bin/init-project.sh / bin/install-tests.sh copy tests/e2e/*.js into a project but write no package.json and run no npm install. The first verify-module.sh therefore cannot run journeys, monkey or the rendered design audit. HEAD now reports this as one clear row ("e2e harness dependency", verify-module.sh:645-672, from #446/#501), which is a real improvement, but the fix is still "run this command by hand", and on a machine whose cached Chromium is an older revision than the newest playwright the plain fix command still ends in a browser launch failure. The follow-up that #502 left open ("install the e2e harness from init-project.sh / sync-project.sh") is listed there as not done, and #502 is closed.
Repro
mkdir -p /tmp/r9/tests/e2e && cd /tmp/r9
cp <toolkit>/project-tests/e2e/helpers.js tests/e2e/
ls # no package.json, no node_modules
node -e 'try{require.resolve("playwright",{paths:["tests/e2e"]})}catch(e){console.log("missing:",e.code)}'
With a real scaffold: bin/init-project.sh <dir> (or sync-project.sh), then bin/verify-module.sh MyModule.
Observed
missing: MODULE_NOT_FOUND
and, from a fresh scaffold, the summary starts with the FAULT row "e2e harness dependency: not installed: playwright axe-core" plus the instruction (cd "$ROOT" && npm install playwright axe-core && npx playwright install chromium). Nothing in the scaffold ran that command. In the field run the only cached Chromium was revision 1217 (older than any playwright the project could install), so after npm install the harness still needed a matching playwright plus npx playwright install chromium-headless-shell, done by hand in a scratch directory.
Expected
The scaffold (or doctor.sh --fix, or test-stack-up.sh as a first-use step) creates a pinned package.json for the harness, runs npm ci, installs the matching browser, and exports the module path so the harness scripts find it wherever the project keeps them. doctor.sh should say whether the browser revision on the machine matches the installed playwright.
Root cause
bin/install-tests.shhas nonpm/package.jsonstep (grep returns nothing);bin/init-project.sh:387-399andbin/sync-project.sh:1334-1394copy and refresh the engine files only.bin/doctor.sh:1689merely prints a note: "e2e additionally needs a Playwright browser in the project: npx playwright install chromium".project-tests/e2e/helpers.js:21-32degrades to a clear INSTRUMENT FAULT (good), and itsFALLBACK_CHROMIUM(:46-51) points at/opt/pw-browsers/chromium, a container path, so a workstation with an older cached browser gets no fallback at all.
Workaround
cd <project> && npm install playwright axe-core && npx playwright install chromium
If a browser launch still fails with a revision error, install the headless shell for the same playwright version (npx playwright install chromium-headless-shell) or pin playwright to the revision already cached.
Suggested fix
Provide project-tests/e2e/package.json with exact versions, copy it with the engine, run npm ci and the browser install from install-tests.sh (idempotent, skipped when node_modules/playwright already resolves), and add the revision check to doctor.sh. Keep the existing verify-module probe as the safety net.
Related
Closed: #446 and PR #501 (probe and one-row report, done), #502 (follow-ups, the install item still open in substance). Open, related scope: #525 (local lane: what runs where).
Versions
- mxcli: nightly-20261105-f3c4d531d (not involved)
- Mendix: 11.15.0
- Toolkit: 97c1139c (field run used c9dedb11; every file:line above was re-read at 97c1139c)
🤖 Generated with Claude Code
Activity
MendixMau commentedon Nov 6, 2026
Triage: DISCUSS track. instrument gap / portability, verified by inspection
Root cause / Problem:
bin/install-tests.shhas nonpmorpackage.jsonstep (grep finds nothing).bin/init-project.sh:386-402andbin/sync-project.sh:1334ffcopy engine files only.bin/doctor.sh:1689is only a note.project-bin/verify-module.sh:645-667reports the one FAULT row with the manual fix.project-tests/e2e/helpers.js:46-60falls back only to the container path/opt/pw-browsers/chromium.PW_EXECUTABLE(helpers.js:53) already lets a workstation point at its cached browser. That is today's best workaround, but the FAULT text doesn't mention it. The issue's line numbers are current. #502 is closed; #525 (local lane) is related.Value: M. Every fresh project's first verify-module FAULTs on the e2e rungs, and the browser-revision case costs a manual round trip.
Risk of fixing: M. A network install at scaffold or sync can fail offline or behind a proxy (it must be non-fatal) and adds hundreds of MB. On Git Bash,
npx/npmare.cmdshims (field-proof rule 3).Rigidity check: n/a (DISCUSS: new artifact and a new scaffold step)
Process cost (#687): per project (scaffold/sync) or per machine (doctor). Option 2 is est. +30–120 s and ~150–300 MB once per project. Nothing per build row. Today: one FAULT and a manual fix per new project.
Needs clarification: no
Learning value: learned rule in the test/doctor skill docs: the harness ships its own pinned manifest, and the browser revision must match the installed playwright.
Proposed fix / Options:
project-tests/e2e/package.json(plus lockfile), copied by install-tests.sh. The FAULT text becomesnpm ci+npx playwright install chromiumand mentionsPW_EXECUTABLE. All entry modes that run e2e. Risk L, no scaffold cost.npm ciand the browser install when node is present and playwright does not resolve (opt-out env var, non-fatal). Risk M, cost above.doctor.shchecks the cached browser revision against the installed playwright, anddoctor.sh --fixinstalls on demand. Risk L, cost per machine, on request only.Proof: a scoped fixture that runs install-tests.sh into a temp project and asserts
tests/e2e/package.jsonexists. Fails on master.Effort: M. Recommendation: DISCUSS: options 1 + 3. Decision needed: may init/sync run a network
npm ciand browser download, or should they only ship the pinned manifest and leave the install to one command ordoctor.sh --fix?Labels: kind/bug, size/m (kind/process proposed, not synced)
Reply go (FIX) or go option N (DISCUSS). Fix PRs still get independent review and your merge.
Generated by Claude Code