mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-09 12:17:13 +00:00
The guard already checked that every <NAME>_SERVICE_ENABLED flag a role
declares is gated by a service-gating helper in its spec. It now also checks
the reverse: every service a role's own specs gate through one of the STRICT
helpers must have its flag declared in that role's env template. Those helpers
raise on a service the registry does not know, so an undeclared gate fails the
scenario at runtime, and in a swarm round that costs a two-hour job to learn a
typo. The tolerant safeSkipUnlessEnabled / safeIsEnabled pair stays exempt,
since reading an unknown service as disabled is exactly what it is for.
Both directions enumerated a role's specs with spec_path.parent.glob('*.js'),
and glob does not recurse, so the whole files/playwright/addons/ tree was
invisible - the directory the addon work lives in. They use rglob now, fed
through iter_project_files from utils.cache.files, because a raw project-tree
walk in test code is refused by its own lint; that keeps it at one filesystem
walk per session instead of one per role. skipUnlessServiceDisabled is added to
both helper patterns: it is used live in web-app-openproject's gitlab_integration
spec and was named in neither.
Three '# nocheck: playwright-service-gate' markers in web-app-matrix's env
template justified themselves with 'which this check does not scan'. That is no
longer true, and measuring rather than assuming shows they are not merely
mis-worded but obsolete: with the markers removed the test is green, because the
gates inside the addon specs are now credited directly.
Residuals: the scan reaches 60 addon specs it had never seen, so green means
'all of them declare their flags' only as of this run. And addon-gating.js
returns false for an absent env key where service-gating.js throws, so a
mistyped addon id still skips silently and no lint covers that.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Playwright Parity Tests 🎭
Integration tests that pin the meta/services.yml ↔ templates/playwright.env.j2 ↔ files/playwright/playwright.spec.js parity contract: every enabled service surfaces as <NAME>_SERVICE_ENABLED=, every env line is consumed by a gating helper in the spec, and # nocheck: playwright-service-flag / # nocheck: playwright-service-gate are the only suppressions.
Tests in this directory MUST only cover Playwright env-template / spec parity. The dashboard-scope sub-rule MUST live under dashboard/.
For framework and make test-integration usage see integration.md.