Skip to content

ci: run the CLI suite under Bun - #43

Merged
jameslcowan merged 5 commits into
mainfrom
ci/bun-smoke
Nov 12, 2026
Merged

jameslcowan merged 5 commits into
mainfrom
ci/bun-smoke

Conversation

@jameslcowan

Copy link
Copy Markdown
Collaborator

What changed

bunx complex-md runs the CLI on Bun, and CI ran the suite on Node 22 and 24 only. Under Bun 1.3.14, 827 of 830 tests passed, 2 are todo and 1 failed. The failure was in cli/test/hosted.test.js: the malformed map was dropped as the test expects, but the check matched V8's error text only. Bun's engine says "No default value" for the same error.

  • cli/test/hosted.test.js accepts both error texts. The behavior it checks is unchanged.
  • A new bun job in ci.yml runs bun bin/complex-md.js --version and bun test in cli/ on Ubuntu, with oven-sh/setup-bun pinned to the v2.2.0 commit and Bun pinned to 1.3.14.

How it was tested

  • bun test test/hosted.test.js: 18 pass. node --test test/hosted.test.js: 18 pass.
  • Under Bun: --version, signals, verify and lint all run on this repository.

AI assistance

  • An AI tool helped write this change. Claude Code (Claude Opus 5.5) wrote the commit and this description.
  • Each commit the tool helped write has an Assisted-by: or a Co-Authored-By: trailer.
  • A person read the whole diff and will answer the review comments.
  • Or: a maintainer agent opened this pull request, and "Maintainer agents" in CONTRIBUTING.md decides who merges it (gated: the owner label).

🤖 Generated with Claude Code

jameslcowan and others added 2 commits November 7, 2026 01:47
Intent: keep `bunx complex-md` tested, since it runs the CLI on Bun.

CI ran the suite on Node 22 and 24 only. Under Bun 1.3.14, 827 of 830
tests passed, 2 are todo and 1 failed. The failure was hosted.test.js:
the malformed map was dropped as expected, but the check matched V8's
error text only, and Bun says "No default value". The check now accepts
both. A new bun job runs --version and bun test in cli/, with setup-bun
pinned to a commit.

Verify: bun test test/hosted.test.js 18 pass; node --test the same file
18 pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Intent: make the bun job pass on the runner as it passes on a full clone.

The first run failed 2 tests: repro.test.js and paths.test.js. Both call
t.skip() on a shallow clone or without ripgrep, and Bun's node:test
throws NotImplementedError on t.skip() (oven-sh/bun#5090). The job now
checks out the full history and installs ripgrep, so both tests run.

Verify: on a full clone with ripgrep, bun test in cli/ gave 0 failures
other than the hosted.test.js text fixed in the previous commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Problem: bun test stops a test after 5 s, and node --test has no limit.
On a host where the bench sandbox runs, 1 sandbox test took longer, and
Bun's node:test then stayed inside it: the next 80 files failed with
"test() inside another test()", 82 failures in all. CI skips the sandbox,
so it passed, but 1 slow test on a slow runner would fail the job the
same way. The job also installed ripgrep without apt-get update, which
fails when the runner's package index is out of date. The job comment
named `bunx complex.md`, a package that npm does not have yet.

Change: bun test runs with --timeout 120000, apt-get update runs before
the install, and the comment names `bunx complex-md`. With the limit
lifted, the suite under Bun 1.3.14 passes on that host: 828 pass, 2 todo,
0 fail.

Intent: the Bun job fails on a Bun incompatibility, not on test length.

Assisted-by: Claude
# Conflicts:
#	CHANGELOG.md
Problem: #4 moved every actions/checkout pin to 7.0.1, but the bun job
was written before it and still pinned 4.4.0, so 1 workflow used 2
checkout versions and Dependabot would open a second update for it.

Change: the bun job uses the same 7.0.1 commit pin as the test matrix.

Intent: 1 checkout version across all workflows.

Assisted-by: Claude

@jameslcowan jameslcowan left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Review: 3 small fixes pushed, then merge.

What I checked.

  • The hosted.test.js change widens 1 regular expression to accept the JavaScriptCore message. The test still checks that the malformed map is dropped and the other pages are written, so no behavior check got weaker.
  • oven-sh/setup-bun is pinned to 0c5077e, which is the commit of the tag v2.2.0, and Bun to 1.3.14. Both pins make the job repeatable.
  • cd cli && npm test on Node passes. CI is green on both runs.
  • I ran bun test in cli/ with Bun 1.3.14 on a Linux host where the bench sandbox works. That run found the first fix below.

Fixes, pushed as a18b61d, then a merge from main (ab045bf) and 1464905.

  1. Bun's 5 s test limit. bun test stops a test after 5 s; node --test has no limit. On that host, 1 sandbox test in bench-sandbox.test.js ran longer and was stopped. Bun's node:test then stayed "inside" that test, and the next 80 files failed with test() inside another test() is not yet implemented: 82 failures from 1 slow test. CI passed only because it skips the sandbox. The job now runs bun test --timeout 120000; on the same host that gives 828 pass, 2 todo, 0 fail.
  2. apt-get update before apt-get install ripgrep. Without it, the install fails when the runner image's package index is older than the mirror. That failure has nothing to do with the code.
  3. The job comment named bunx complex.md. That package is not on npm yet (#41 keeps every text on complex-md until it is), so the comment now says bunx complex-md.

After #4 merged, 1464905 moved the job's actions/checkout pin from 4.4.0 to 7.0.1, so all jobs use 1 checkout version. The merge from main kept both Unreleased CHANGELOG entries, this one on top.

Worth knowing. The bun job is not a required check, and it runs the same tests that Node runs. A Bun-only failure points at Bun's node:test support first. oven-sh/bun#5090 (nested tests) is the 1 to watch: when it ships, the job can drop the full history and ripgrep that it adds now.

Process note. Routine under "Maintainer agents": CI and a test fix, no release file.

@jameslcowan
jameslcowan merged commit 16d6770 into main Nov 12, 2026
8 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.

1 participant