Skip to content

test(cookbook): check that examples really render, add next-js and actionlint CI - #562

Merged
gre merged 2 commits into
masterfrom
test/cookbook-e2e-render
Nov 5, 2026
Merged

gre merged 2 commits into
masterfrom
test/cookbook-e2e-render

Conversation

@gre

@gre gre commented Nov 4, 2026

Copy link
Copy Markdown
Owner

The cookbook e2e passed even when nothing was drawn: it ignored WebGL errors and tolerated a missing canvas. examples/next-js wasn't built by any workflow.

Changes

e2e (pnpm e2e and pnpm e2e:prod)

  • Chromium runs on SwiftShader with a fake camera, so shaders and webcam examples really run.
  • Each example's first canvas must draw at least 4 distinct colors, with no uncaught error, console error or same-origin HTTP failure.
  • In development a shader error is an overlay rather than an exception, so the test also fails on that overlay.
  • paint starts blank, so the test draws on it first. It's the only special case.
  • imgur images are replaced by a local file, so an imgur outage can't fail the suite. As a result, the real remote URLs are not tested.
  • Example ids are read from src/examples/index.ts, so a new example can't be left out.
  • A new test goes from the home page to examples through links, and checks that the page doesn't reload.

Next.js example

  • ci-next-js.yml builds it and checks that the page renders (pnpm e2e:next).
  • This found a real crash when building inside this repository: Cannot destructure property 'glSurface' of 'this.context'. A copy outside the repository rendered fine, so Next was using the repository root as the project root. examples/next-js/next.config.js now sets the root to the example. I didn't determine exactly why that root breaks the page.

actionlint

  • ci-actionlint.yml checks workflow changes on PRs. It reports nothing on the current workflows.

Testing

Locally, on macOS:

  • pnpm e2e: 51/51, twice. pnpm e2e:prod: 51/51, twice. pnpm e2e:next: passes.
  • Blank shader in hellogl: fails in dev with Expected: >= 4, Received: 1.
  • Shader compile error in hellogl: fails in dev on the overlay, and in production on a page error and a blank canvas.

Not tested:

  • What each example should look like: the check only proves that several colors are drawn, not that they are the right ones.
  • Canvases after the first one in an example.
  • Interactions other than drawing on paint.

No changeset: the cookbook is private, and the Next.js example isn't published.

🤖 Generated with Claude Code

…tionlint CI

The e2e suite passed even when nothing was drawn: it ignored WebGL errors and
tolerated a missing canvas. It now runs real shaders on software WebGL and
requires each canvas to draw several colors, with no page errors. It reads the
example list from the index, and stubs imgur so an outage can't fail it. A new
test also navigates through links without reloading the page.

examples/next-js wasn't built by any workflow. A new job builds it and checks
that its page renders. This found a real crash when building inside this
repository: Next used the repository root as the project root, which next.config.js now overrides.

actionlint now checks workflow changes on PRs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 4, 2026 16:27

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

Comment thread .github/workflows/ci-next-js.yml Fixed
Addresses CodeQL actions/missing-workflow-permissions. Without a permissions
block, these jobs inherit the default GITHUB_TOKEN permissions, and they only
need to read the repo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gre
gre merged commit c5bed57 into master Nov 5, 2026
9 checks passed
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.

3 participants