ci(examples): wire Playwright e2e suites into check and CI#71
Merged
Conversation
The three demos' Playwright e2e suites (Chrome CDP virtual WebAuthn) were never run by Gradle or CI. Wire them in via a new `pkauth.e2e-conventions` plugin that registers an opt-in `e2eTest` task per demo: - Gated on PK_RUN_E2E=1 (or -PrunE2e); only then does `check` depend on it, so the default local `check` and the existing CI `build` job stay fast and Chrome-free. Resolved to a plain Boolean at configuration time so the wiring is configuration-cache-safe. - A shared BuildService lock (maxParallelUsages=1) serializes the suites across a single build, since every demo's webServer binds :8080 and org.gradle.parallel=true would otherwise let them collide. - Adds a CI `e2e` matrix job (one isolated runner per adapter, fail-fast false) that flips the flag and installs Chrome via PW_INSTALL_DEPS. Also fixes two pre-existing defects the suites surfaced once they actually ran: - playwright.config.ts (all 3): the webServer ran `../../../gradlew` from the e2e/ dir, so Gradle took e2e/ as the project dir and failed. Pass `-p ../../..` to root Gradle at the repo. - micronaut-demo: dev-mode was set only in application.yml, which (like the relying-party keys) does not reach bean conditions reliably — so the @requires(pkauth.dev-mode=true) LoggingEmailSender/LoggingSmsSender beans never activated and the unconditional magicLinkService/otpService singletons failed to inject EmailSender/SmsSender (500 at request time). Pass -Dpkauth.dev-mode=true as a system property in the run task. All three suites now pass 5/5. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
wolpert
enabled auto-merge (rebase)
June 14, 2026 04:25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What
The three demos (
spring-boot-demo,dropwizard-demo,micronaut-demo) each carry a Playwright e2e suite that drives the full passkey ceremony through Chrome's CDP virtual WebAuthn authenticator — but nothing ran them: they weren't Gradle subprojects and no workflow referenced them. This wires them into both Gradlecheckand CI.Wiring (
pkauth.e2e-conventionsplugin)e2eTesttask that doesnpm ci→npx playwright install chrome→npx playwright test(the PlaywrightwebServerboots the demo via its Gradleruntask).checkonly whenPK_RUN_E2E=1(or-PrunE2e) is set, so a default local./gradlew checkand the existing CIbuildjob stay fast and Chrome-free. The flag is resolved to a plainBooleanat configuration time, keeping the wiring configuration-cache-safe.:8080, andorg.gradle.parallel=truewould let siblinge2eTesttasks collide. A sharedBuildServicelock (maxParallelUsages = 1) serializes them across a single build (no-op in CI, where each demo runs on its own runner).CI
e2ematrix job — one isolatedubuntu-latestrunner per adapter,fail-fast: false, flipsPK_RUN_E2E=1and installs Chrome + OS deps viaPW_INSTALL_DEPS=1. Parallel across runners, so the shared:8080is a non-issue.Pre-existing bugs fixed (surfaced once the suites actually ran)
playwright.config.ts(all 3): the webServer invoked../../../gradlewfrom thee2e/dir, so Gradle tooke2e/as the project dir and failed ("not part of the build"). Pass-p ../../..to root Gradle at the repo. This only ever "passed" before when a demo was already running on :8080 andreuseExistingServerreused it.micronaut-demoDI bug:magicLinkService/otpServiceare unconditional singletons requiringEmailSender/SmsSender, but those beans are@Requires(property = "pkauth.dev-mode", value = "true").dev-modewas set only inapplication.yml, which — like the relying-party keys (per the existing workaround in that build file) — doesn't reach bean conditions reliably, so the senders never activated and magic-link/OTP routes 500'd. Fixed by passing-Dpkauth.dev-mode=trueas a system property in theruntask. (This demo had no prior tests, so the e2e suite is the first end-to-end exercise of it.)Validation
All three suites pass 5/5 locally, including a single root-level
PK_RUN_E2E=1run across all three demos (verifying the serialization lock):🤖 Generated with Claude Code