Skip to content

test: run the end-to-end tests on the image - #99

Merged
AnonymousXC merged 6 commits into
devfrom
test/79-e2e-image-v2
Nov 16, 2026
Merged

AnonymousXC merged 6 commits into
devfrom
test/79-e2e-image-v2

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

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 on dev (#84), so this PR doesn't change app code.

Summary

  • playwright.config.ts: with E2E_IMAGE set, 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 NAME passes each setting from the environment, so no value, LOGIN_PROVIDERS included, 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 empty E2E_IMAGE counts as unset.
  • CI: the new job e2e-image ("End-to-end tests (image)") runs the Chromium journey against the image of Build image on pull requests, and against the pushed digest on pushes. publish and CI passed need it, so the ruleset stays unchanged. The job pins ubuntu-24.04, because Playwright 1.56 can't install Chromium on ubuntu-latest (26.04). A comment says when to drop the pin. It can't run in the Playwright image like e2e does, as it needs the runner's Docker.
  • Release: the new job 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:
    • docs/development/index.md explains 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.md and docs/operator-guide/deployment.md list the new checks.
    • The README has no Tests section and links to the development docs, so it is unchanged.

Verification

  • Image: docker build -t krini-79:e2e-local ., then CI=1 E2E_IMAGE=krini-79:e2e-local npx playwright test --project chromium → 14 passed. Re-run after the review fixes: 14 passed. Afterwards no krini-e2e container was left.
  • Checkout build: CI=1 npx playwright test --project chromium → 14 passed.
  • Input guards: E2E_IMAGE values containing ;, $(...) or a quote are rejected before anything starts. An empty E2E_IMAGE lists the normal 28 tests.
  • Unit tests: bun run test:coverage → 100% statements, branches, functions and lines.
  • Static checks:
    • bun run lint → clean.
    • bunx next typegen && bunx tsc --noEmit → clean.
    • actionlint (with shellcheck) → clean.
    • mkdocs build --strict → clean.
  • Reviews: adversarial-reviewer and quality-reviewer, two rounds. No high findings. Accepted low findings are fixed; one medium finding is declined (below).
  • Not run: the release workflow's e2e job only runs on a version tag. It uses the same steps as e2e-image, apart from pulling the image by digest, which follows the release smoke job.
  • Sourcery: the certificate directory is now mounted in single quotes, so checkout paths with spaces work (79979ac). Verified from a worktree whose path contains a space: 14 passed.
  • CI: green on 79979ac, including End-to-end tests (image) (1m14s) and CI passed. The Vercel preview check fails, as it does on dev (0363f87); it isn't part of CI.

Declined review findings

  • Unit tests for the E2E_IMAGE and certificate-path guards (medium): the guards are in playwright.config.ts, which is test configuration. Vitest only covers src/, and Playwright's testDir (e2e/) would pick up a *.test.ts file 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).
  • Repeated digest check and Playwright setup across the CI and release jobs (low): this follows the existing pattern of the image, scan and smoke jobs. 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:

  • Add support for running Playwright end-to-end tests against a Docker image in its deployed runtime configuration.
  • Run image-based end-to-end tests for CI-built and release image digests before publication or signing.

Enhancements:

  • Share application test settings between checkout and image runs and prevent unsafe image or certificate-path inputs.
  • Document local image-based end-to-end testing and update release and deployment verification guidance.

CI:

  • Add CI and release workflow jobs that execute Chromium end-to-end tests against the appropriate Docker image and make publication depend on their success.

Documentation:

  • Document image-based end-to-end testing and include it in release and deployment checks.

uniqueg and others added 4 commits November 16, 2026 10:17
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]>
@uniqueg uniqueg self-assigned this Nov 16, 2026
@vercel

vercel Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
krini Ready Ready Preview Nov 16, 2026 2:00pm UTC

@sourcery-ai

sourcery-ai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Implementation

Add an image-backed Playwright app mode that validates its inputs and runs the container with deployment-like settings, alongside the existing checkout-build mode.

  • playwright.config.ts L16-20, L25-104, L136-139 (+2 small edits)

Configuration

Run 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.

  • .github/workflows/ci.yml L334-405 (+4 small edits)
  • .github/workflows/release.yml L10-14, L344-394

Documentation

Document local image-based end-to-end testing and describe the added CI and release checks in the development, releasing, and deployment guides.

  • docs/development/index.md L106-126
  • docs/development/releasing.md L149-153
  • docs/operator-guide/deployment.md L49-53, L131-132

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codecov

codecov Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (44da7eb) to head (1fe7451).

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@read-the-docs-community

read-the-docs-community Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

@uniqueg
uniqueg marked this pull request as ready for review November 16, 2026 09:36
@uniqueg
uniqueg requested a review from AnonymousXC as a code owner November 16, 2026 09:36
@sourcery-ai

sourcery-ai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Linked issues

Checked at commit 1fe7451

#79 test: run the end-to-end tests on the image · 2 of 3 met

# Requirement Status Notes
1 CI runs the end-to-end journey against the built image, and CI passed needs it. ✅ Met The e2e-image job runs the Chromium tests against the image, and both publish and CI passed depend on it.
2 The release workflow runs the tests against the release digest before tagging. ✅ Met The release e2e job tests the pushed digest, and release-image depends on it.
3 Document in the README's Tests section how to run the journey against a local image. 🟡 Partly met The local-image instructions are in docs/development/index.md, but the README is unchanged and has no Tests section.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread playwright.config.ts Resolved
Comment thread docs/development/index.md Resolved
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]>
@vercel
vercel Bot temporarily deployed to Preview – krini November 16, 2026 09:54 Inactive

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sourcery assessment

Approved.

@vercel
vercel Bot temporarily deployed to Preview – krini November 16, 2026 14:00 Inactive
@AnonymousXC
AnonymousXC merged commit d8e1878 into dev Nov 16, 2026
44 checks passed
@AnonymousXC
AnonymousXC deleted the test/79-e2e-image-v2 branch November 16, 2026 14:04
uniqueg added a commit that referenced this pull request Nov 19, 2026
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]>

This branch was previously deployed

1 inactive deployment
Preview – krini — 1fe7451c Deployed Nov 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: run the end-to-end tests on the image

2 participants