Skip to content

test against fixtures made by super in CI - #1

Draft
philrz wants to merge 1 commit into
mainfrom
ci-super-main
Draft

philrz wants to merge 1 commit into
mainfrom
ci-super-main

Conversation

@philrz

@philrz philrz commented Nov 17, 2026

Copy link
Copy Markdown
Contributor

The Problem

super-ts reimplements parts of super: a BSUP decoder, and a SUP formatter that has to match super -f sup byte for byte. Its reference tests compare it with output that super made when the fixtures were saved (v0.4.0-58, Nov 13), so they keep passing however super changes later. Nothing runs them automatically, either.

Also, npm run fixtures skips any fixture that super can't make and still exits 0, and the tests skip missing fixtures. With no super at all, npm test still passes, with the reference tests marked as skipped.

The Changes

  • A workflow, test.yaml, that runs on each pull request, nightly at 08:05 UTC, and on demand, like super's markdown-lint.yaml. It type checks and runs the tests with the saved fixtures, then builds super, makes the fixtures again, and runs the tests with those. It uses Node 22.18, the oldest version package.json allows.
  • As superdb-python's CI does, it also runs after each merge to main here and after each pull request merged in super, where it tests the commit that merged. That needs super-ts added to super's notify-downstream-merge.yaml, which I'll do in a super PR once this one merges. It can also be run by hand against any super branch, tag, or commit.
  • Failures on main are posted to Slack the same way markdown-lint.yaml's are, with the SLACK_WEBHOOK_BRIMLABS_TEST webhook that super's "Notify main failure" workflow uses. Runs started by hand aren't posted.
  • npm run fixtures now exits nonzero if super can't make a fixture, after making the rest.
  • A lockfile, so CI installs the same TypeScript and @types/node each time, and a failure points at super rather than at a new release of either.
  • The README says what CI does.

Testing

I made this change with Claude Code. I ran npm run fixtures and the tests locally on Node 22.18.0 with four builds of super:

super npm run fixtures Tests
v0.4.0-74-g4263b1202 (main) exits 0 150 pass
none exits 1 (exited 0 before this change) 94 pass, reference tests skipped
v0.4.0-31-gf52b66993, which writes BSUP 0.30 exits 0 56 fail with version mismatch: expected 0.31, found 0.30
a wrapper that fails whenever it's asked for BSUP exits 1 (exited 0 before this change) 95 pass

The third row stands in for a future change in super. The next BSUP version bump will fail CI the same way. npm run check passes, and actionlint finds no problems in the workflow. This PR's own run is its first real test on GitHub.

A /code-review high pass found 10 issues. Seven were fixed: Node is now pinned to 22.18 as the comment said; the workflow runs after merges here and tests the exact super commit that merged; runs started by hand don't post to Slack; the job's token is read-only (the repo's default is read/write); and the fixture check moved from the workflow into npm run fixtures as an exit status, which covers local runs too and no longer counts a fixture with empty output (0-byte files) as missing. I declined three:

  • The Slack webhook not being visible to this repo. It's an organization secret, and GitHub's API lists it as available to super-ts.
  • The cost of a full clone of super and make build. super's history is about 52 MiB and make build builds three commands, and the tags give super -version its v0.4.0-75-g008edd5fc form, which is what we paste into issues.
  • Pull requests going red when super changes. superdb-python's CI also tests pull requests against super's main, and the two test steps have separate names, so a run shows whether the pull request or super caused the failure.

🤖 Generated with Claude Code

Add a GitHub Actions workflow that runs on each pull request and merge,
nightly, on demand, and after each pull request merged in super (the
super-pr-merged event that superdb-python's CI also gets). It type checks,
runs the tests with the saved fixtures, then builds super, makes the
reference fixtures again, and runs the tests with those. A change in
super that super-ts doesn't match yet, such as a new BSUP version or a
change in SUP output, makes it fail.

The fixture script skipped any fixture super couldn't make and exited 0,
and the tests skip missing fixtures, so with no working super everything
passed.  The script now exits nonzero when super can't make a fixture.

Failures on main are posted to Slack as markdown-lint's are in super,
except for runs started by hand.

Add a lockfile so CI installs the same TypeScript and @types/node each
time.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@philrz
philrz requested a review from mccanne November 17, 2026 21:18
@philrz philrz self-assigned this Nov 17, 2026
@philrz
philrz marked this pull request as draft November 20, 2026 01:52
@philrz
philrz removed the request for review from mccanne November 20, 2026 01:52
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.

1 participant