Repository navigation
test: run the end-to-end tests on the image - #99
Conversation
With E2E_IMAGE set, Playwright starts that Docker image as the app instead of building the checkout: as the image's non-root user, with a read-only root file system, a writable /tmp and all settings at start, on the host network, with the mock services' certificate mounted. The settings are shared with the build of the checkout. Rebuilt from #82 on current dev. Co-Authored-By: Claude Opus 5.5 <[email protected]>
CI's new e2e-image job runs the Chromium journey against the image of the Build image job (pull requests) or the pushed digest (pushes); both publish and CI passed need it. The release workflow's new e2e job does the same with the release digest before release-image attests, signs and tags it. Both run on Ubuntu 24.04, as Playwright 1.56 can't install Chromium on ubuntu-latest (26.04). The development docs say how to run the tests against a local image; the release and deployment docs list the new checks. Co-Authored-By: Claude Opus 5.5 <[email protected]>
An empty E2E_IMAGE counts as unset. On pushes, the e2e-image job tests the pushed digest by name instead of a local scan tag. The development docs say that image runs need Playwright on the host, not in its image, and the deployment docs that the end-to-end tests run on the build and again on the image. The workflow headers are re-wrapped. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Reviewer's GuideImplementationAdd an image-backed Playwright app mode that validates its inputs and runs the container with deployment-like settings, alongside the existing checkout-build mode.
ConfigurationRun Chromium end-to-end tests against the built or pushed CI image and the release digest, and make those checks prerequisites for publishing and releasing.
DocumentationDocument local image-based end-to-end testing and describe the added CI and release checks in the development, releasing, and deployment guides.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #99 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 20 20
Lines 566 566
Branches 161 161
=========================================
Hits 566 566 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Linked issuesChecked at commit 1fe7451 #79 test: run the end-to-end tests on the image · 2 of 3 met
|
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="playwright.config.ts" line_range="38" />
<code_context>
+ `E2E_IMAGE has characters of no image reference: '${image}'`,
+ );
+}
+if (image !== undefined && !/^[\w./-]+$/.test(certPath)) {
+ throw new Error(
+ `Run the tests with E2E_IMAGE from a plain path, not '${certPath}'`,
</code_context>
<issue_to_address>
**Checkout paths with spaces fail**
When the repository checkout path contains a space, the guard throws before Docker starts, so the image tests cannot run from a checkout whose absolute path contains a space and the caller sees a configuration error.
Quote or safely escape the certificate mount path in the Docker command instead of rejecting paths with spaces.
</issue_to_address>
### Comment 2
<location path="docs/development/index.md" line_range="106-121" />
<code_context>
+ To run them against a Docker image instead of the build of the
</code_context>
<issue_to_address>
**README test instructions**
The issue asks for local-image instructions in the README's Tests section. This change adds those instructions to the development docs instead, leaving the requested README section unaddressed.
</issue_to_address>Sourcery assessment
Approval pending. 1 finding to address first.
Blocking findings: playwright.config.ts:38
The certificate directory is mounted in single quotes, so a checkout path with spaces works; only single quotes, line breaks and ':' (the separator of --volume) are rejected. Found by Sourcery. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Set date-released to 2026-11-19 and reorder the CITATION.cff authors by lines added on dev (without lock files, public/ and src/components/ui/, as in #74). Add everything merged since the first draft to the release notes: TES tasks with the user's token (#90), the WES run details (#100), the minimal dashboard (#108), the Helm chart (#92, #95), the image end-to-end tests (#99), the deployment docs (#101), the Next.js update (#102) and the fixes #109 and #110. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Closes #79
Supersedes #82 (rebuilt on current dev as Chitransh asked). The branch starts from current
dev, and the docs were written fresh against dev's docs, so nothing of #82's older docs comes back. The login callback fix of #82 is already ondev(#84), so this PR doesn't change app code.Summary
playwright.config.ts: withE2E_IMAGEset, Playwright starts that Docker image as the app instead of building the checkout. The image runs as it is deployed: as its non-root user, with--read-only --tmpfs /tmp, and with all settings given at start.--env NAMEpasses each setting from the environment, so no value,LOGIN_PROVIDERSincluded, appears on the command line. The container uses the host network and gets the mock services' certificate mounted. The image reference is validated before it goes into the shell command. The certificate path is single-quoted and must not contain single quotes, line breaks or:. The settings (appEnv) are shared with the build of the checkout, so the two runs can't drift apart. An emptyE2E_IMAGEcounts as unset.e2e-image("End-to-end tests (image)") runs the Chromium journey against the image ofBuild imageon pull requests, and against the pushed digest on pushes.publishandCI passedneed it, so the ruleset stays unchanged. The job pinsubuntu-24.04, because Playwright 1.56 can't install Chromium onubuntu-latest(26.04). A comment says when to drop the pin. It can't run in the Playwright image likee2edoes, as it needs the runner's Docker.e2e("End-to-end tests (release image)") runs the same tests against the exact release digest, without credentials.Release image(attest, sign, tag) now needs it.docs/development/index.mdexplains how to run the tests against a local image, what that needs, and how to remove a container that a killed run left behind.docs/development/releasing.mdanddocs/operator-guide/deployment.mdlist the new checks.Verification
docker build -t krini-79:e2e-local ., thenCI=1 E2E_IMAGE=krini-79:e2e-local npx playwright test --project chromium→ 14 passed. Re-run after the review fixes: 14 passed. Afterwards nokrini-e2econtainer was left.CI=1 npx playwright test --project chromium→ 14 passed.E2E_IMAGEvalues containing;,$(...)or a quote are rejected before anything starts. An emptyE2E_IMAGElists the normal 28 tests.bun run test:coverage→ 100% statements, branches, functions and lines.bun run lint→ clean.bunx next typegen && bunx tsc --noEmit→ clean.actionlint(with shellcheck) → clean.mkdocs build --strict→ clean.adversarial-reviewerandquality-reviewer, two rounds. No high findings. Accepted low findings are fixed; one medium finding is declined (below).e2ejob only runs on a version tag. It uses the same steps ase2e-image, apart from pulling the image by digest, which follows the releasesmokejob.End-to-end tests (image)(1m14s) andCI passed. The Vercel preview check fails, as it does ondev(0363f87); it isn't part of CI.Declined review findings
E2E_IMAGEand certificate-path guards (medium): the guards are inplaywright.config.ts, which is test configuration. Vitest only coverssrc/, and Playwright'stestDir(e2e/) would pick up a*.test.tsfile there, so testing the guards would need a new test setup, which is beyond test: run the end-to-end tests on the image #79. They were checked by hand (see Verification).image,scanandsmokejobs. Sharing them would change those existing jobs as well.Open questions
None.
🤖 Generated with Claude Code
Summary by Sourcery
Validate deployed Docker images with the end-to-end test suite before they are published or released.
New Features:
Enhancements:
CI:
Documentation: