Skip to content

add CI that builds SuperLens and runs browser smoke tests - #12

Merged
philrz merged 1 commit into
mainfrom
ci-checks
Nov 21, 2026
Merged

philrz merged 1 commit into
mainfrom
ci-checks

Conversation

@philrz

@philrz philrz commented Nov 21, 2026

Copy link
Copy Markdown
Contributor

Why

This is the first step toward deploying SuperLens to lens.superdb.org. SuperLens builds with whatever super and super-ts it's given, and today nothing builds or tests it until someone runs npm run build by hand. So a change in either repo can break it unnoticed, e.g., a change to a super API that wasm/main.go uses, or a BSUP version that super-ts doesn't read yet. The deploy will run these same checks first and publish only a build that passes, so the site keeps its last good build when something breaks.

The Change

  • A workflow (.github/workflows/test.yaml) runs on each pull request and merge, and by hand from the Actions tab, where you can pick a branch or commit of super or super-ts to build with. It builds SuperLens with the main of both (the build also type checks the app), then runs the unit tests and the new smoke tests.
  • Smoke tests (e2e/smoke.spec.ts) run the built site in headless Chromium with Playwright, served the way npm run serve serves it, content security policy included. They:
    • open the sample data and check the table and SUP views
    • open a small JSON file with three shapes, check the SUP view, and download it as NDJSON
    • download the sample's results as Parquet and open that file again
    • check that a query error is shown
    • fail if the page throws or logs an error. If a query fails, a test fails with the page's message (e.g., malformed BSUP: version mismatch: expected 0.32, found 0.31).
  • A failed run on main posts a link to it in Slack, as super's CI does. Pull requests and runs by hand don't post.
  • SUPERLENS_URL runs the smoke tests against a site that's already up instead of dist/, such as a new deploy, so the deploy can check the host's real headers.
  • @playwright/test is a new dev dependency, as in the docs site's playground tests. The site still has no runtime dependencies.
  • The README has a new Testing section.

Pinning a super and super-ts commit for each SuperLens commit, as Zui did, would be the other way to stay safe. I went with building from main and gating instead, because a failed build simply doesn't deploy, and SuperLens keeps up with super without anyone bumping a pin.

Testing

Locally with super v0.4.0-100-g4c2b1d4d3 and super-ts 80779cb (both main): the four smoke tests pass in about 4 s, 40 of 40 with --repeat-each 10, and on Node 22.18 (the oldest supported) too. To check that they catch a broken build, I broke a copy of dist/ on purpose:

  • super-ts expecting another BSUP version: the three tests that run queries fail, with the version mismatch message
  • the policy header without 'wasm-unsafe-eval': all four fail with "The query engine failed to load"
  • an error logged on page load: all four fail

The workflow runs for the first time on this PR.

To try the smoke tests locally:

npm install
npm run build
npx playwright install chromium    # once, to download the browser
npm run test:e2e

Not Addressed Here

  • The deploy itself, which comes next, in a separate repo with the hosting credentials. It'll also rebuild nightly to pick up new commits in super and super-ts, so this workflow has no schedule of its own.
  • super-ts's tests against fixtures made by the current super (test against fixtures made by super in CI super-ts#1).

A GitHub Actions workflow builds SuperLens with the main branches of
super and super-ts on each pull request and merge, then runs the unit
tests and new Playwright smoke tests of the built site in headless
Chromium.  The smoke tests open the sample data and small files, check
the table and SUP views, and download results as NDJSON and Parquet,
reopening the Parquet file.  SUPERLENS_URL runs them against a site
that's already up, such as a new deploy.  As in super's CI, a failed
run on main posts to Slack.

This is the first step toward deploying SuperLens to lens.superdb.org:
the deploy will run the same checks before it publishes a build.
@philrz
philrz requested a review from mccanne November 21, 2026 02:46
@philrz philrz self-assigned this Nov 21, 2026
@philrz
philrz merged commit 8fcf0fb into main Nov 21, 2026
1 check passed
@philrz
philrz deleted the ci-checks branch November 21, 2026 02:53
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.

2 participants