feat(ci): add Bun runtime jobs (unit + curated/full e2e)#650
Merged
Conversation
Bun's TypeScript loader does not automatically elide type-only re-exports
the way ts-node does, so `export { CustomResponse }` from `src/index.ts`
threw a SyntaxError ("export 'CustomResponse' not found"). Mark it as a
type-only re-export so both runtimes can load the module.
Adds a `test:bun` npm script that runs the existing mocha suite under
Bun's runtime, plus a `Test on Bun` job in the check workflow so Bun
coverage runs on every PR and release.
https://claude.ai/code/session_01PE9wGrZ1wb7Nuq9czWjJz4
Mocha keeps the process alive while there are open handles. Under Bun some sockets in the integration tests stay open after a failure, which leaves mocha waiting forever and exhausts the job's default 6-hour timeout. Pass --exit so mocha force-exits after the run, and cap the Bun job at 15 minutes as a safety net. https://claude.ai/code/session_01PE9wGrZ1wb7Nuq9czWjJz4
…ort-529IW # Conflicts: # .github/workflows/check.yaml # package.json # src/index.ts
The Bun job timed out on CI running the e2e suite (8m+, exit 255). The e2e tests exercise HTTP/1.1 pipelining through ProxyChain.Server and util.promisify(stream.pipeline) over upstream HTTP responses; both have known runtime gaps in Bun 1.3 that cause individual tests to hang on their per-test mocha timeout, compounding into the job timeout. Limit test:bun to the unit suite so we still validate that the library loads cleanly under Bun and the utility functions behave the same. Document the scope (and the reason) in test/README.md so the next contributor doesn't expand it without checking those Bun bugs are fixed. https://claude.ai/code/session_01PE9wGrZ1wb7Nuq9czWjJz4
- Rename the Bun unit job from 'Tests on Bun' to 'Unit tests on Bun' to
mirror the Node 'Unit tests' naming.
- Tag the Node e2e job as 'E2E tests (Node.js 24)' so the runtime is
visible from the check list.
- Add a 'bun_e2e' job that runs the Bun e2e suite. Scope is controlled
by a new `bun_e2e_mode` workflow input:
* 'compatible' (default on PRs/release) runs a curated subset of
e2e files (currently tcp_tunnel.js + socks.js) that exercise
Bun-friendly code paths.
* 'full' runs the entire e2e suite. Triggered manually via
Actions → Check → Run workflow.
- Add `test:bun:e2e:compatible` and `test:bun:e2e:full` npm scripts and
document the toggle (and how to extend the compatible subset) in
test/README.md.
https://claude.ai/code/session_01PE9wGrZ1wb7Nuq9czWjJz4
The previous compatible subset (tcp_tunnel.js + socks.js) had 4 of 8 test failures on CI. Without log access from this sandbox I can't attribute them to specific tests, so falling back to the minimal subset that is guaranteed to be Bun-safe: the two URL-validation tests in test/e2e/tcp_tunnel.js (selected via --grep 'throws error'). They exercise createTunnel's error paths through chai+mocha without binding sockets, opening upstream HTTP, or otherwise touching the Bun runtime gaps. The README explains how to widen the subset as networked e2e tests are confirmed. https://claude.ai/code/session_01PE9wGrZ1wb7Nuq9czWjJz4
Node.js jobs use parenthesised qualifiers (Unit tests (Node.js 24), E2E tests (Node.js 24)). Bring the Bun jobs into the same shape: - Unit tests on Bun → Unit tests (Bun) - E2E tests on Bun (compatible) → E2E tests (Bun, compatible) https://claude.ai/code/session_01PE9wGrZ1wb7Nuq9czWjJz4
jirimoravcik
approved these changes
May 11, 2026
bliuchak
approved these changes
May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds Bun to CI/CD
Summary
Adds Bun runtime support to proxy-chain, mirroring the existing Node.js CI shape.
Changes
Unit tests (Bun)job — runstest/unit/**under Bun on every PR.E2E tests (Bun, compatible|full)job — runs the e2e suite under Bun. Scope is controlled by a newbun_e2e_modeworkflow input:compatible(default on PRs and the release flow) runs the curated subset of e2e tests known to pass on Bun. Currently the URL-validation tests intest/e2e/tcp_tunnel.js(selected via--grep 'throws error'). Widen as networked tests are confirmed.fullruns every e2e file. Opt-in via Actions → Check → Run workflow, pickingfullfor thebun_e2e_modeinput.test:bun,test:bun:e2e:compatible,test:bun:e2e:full. All usebun --bun run mocha --no-config --exit:--bunforces Bun's runtime instead of Node when mocha's#!/usr/bin/env nodeshebang resolves.--no-configskips master's.mocharc.json, which loadstsxfor Node ESM/TS — Bun transpiles TypeScript natively and chokes on tsx's conditional exports (Cannot find module './cjs/index.cjs').--exitforces mocha to exit when Bun leaves background handles open after a failing e2e test (this is what stuck the original Bun job for 30+ minutes).E2E tests→E2E tests (Node.js 24)so the runtime is visible from the check list, matchingUnit tests (Node.js 20/22/24). The two Bun jobs use the same parenthesised qualifier (Unit tests (Bun),E2E tests (Bun, compatible)).test/README.mddocuments the three Bun scripts, thecompatible/fullmodes, and how to extendtest:bun:e2e:compatibleas more tests pass under Bun.Why
compatibleis narrowThe e2e suite exercises HTTP/1.1 pipelining through
ProxyChain.Serverandutil.promisify(stream.pipeline)over upstream HTTP responses. Both have runtime gaps in Bun 1.3 that cause individual mocha tests to hang on their per-test timeout — the original full-suite run accumulated 8+ minutes of these before falling over with exit 255.compatiblemode therefore starts with validation-only coverage; thefulljob is the canary for tracking the rest as Bun closes those gaps.Library code
No source changes are needed on top of master — the
export type { CustomResponse }fix Bun required is already in the 3.0 release via the CJS-to-ESM migration.https://claude.ai/code/session_01PE9wGrZ1wb7Nuq9czWjJz4