mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 02:54:26 +00:00
Per-role Playwright runs no longer call `npm install` against registry.npmjs.org on every invocation. A new `01_setup.yml` runs once per host/version, populates `_shared/node_modules/` inside the Playwright container, and stamps the installed version in `.installed-version`. Each `02_run_one.yml` mounts that tree read-only at `/e2e/node_modules` and the container command becomes `npx --no-install playwright test`. This eliminates the npmjs.org TLS-handshake flake that took out the keycloak playwright in a recent variant-2 update, saves ~4 s per role, and gives version bumps a single rebuild point. Three retry layers cover transient registry failures: Ansible (3× with 5 s delay), npm fetch (5× with 10-60 s backoff), and image pull (3×). Stage-base / shared-dir / stamp / node_modules paths live as SPOT constants in `vars/main.yml` so call sites never reconstruct them. Renames `tasks/run_one.yml` → `tasks/02_run_one.yml` (and adds `01_setup.yml`) to make the include order visible by filename; updates cross-references in `AGENTS.md`, the two `docs/contributing/...` pages, `dump_disk_diagnostics.sh`, and the lint test. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1.4 KiB
1.4 KiB
Agent Instructions: test-e2e-playwright
This role is the shared Playwright runner for all end-to-end tests in the repository. Changes here affect every application role that uses it.
General Rules
- You MUST keep all changes to this role minimal and non-invasive.
- Before modifying any file in this role, you MUST explain to the user why the change is necessary and ask for explicit confirmation.
- You MUST NOT introduce new override mechanisms (e.g. per-role variable mappings) that bypass the existing environment-variable interface.
- Application roles MUST use the existing variables (
TEST_E2E_PLAYWRIGHT_IMAGE,TEST_E2E_PLAYWRIGHT_COMMAND, etc.) for customisation instead of adding new indirection inside this role.
File-Specific Rules
tasks/02_run_one.yml
- You MUST NOT add new
set_factvariables that shadow or wrap existingTEST_E2E_PLAYWRIGHT_*variables. - You MUST NOT read from role
vars/main.ymlmappings of consuming roles (e.g.test_e2e_playwright.*) to override runner behaviour. - Any change to the task flow MUST leave all existing call sites unaffected.
defaults/main.yml
- New variables MUST follow the
TEST_E2E_PLAYWRIGHT_prefix convention. - Default values MUST be safe to use without any per-role override.
README.md
- Document only variables and behaviour that are actually implemented in the role.
- Do NOT document patterns or extension points that do not exist in the code.