Migrate tests to node:test and convert CI to reusable-workflow callers - #22
Merged
Conversation
Convert the six existing workflow files to thin callers of the shared reusable workflows in unabandoned/.github, and add CodeQL and Scorecard security callers. publish.yml sets id-token: write on the calling job for OIDC. Callers pin @main and pass per-fork inputs (node 20/22/24, has-build: false, install-for-publish: false). Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_012QxAK8mJqNntrB9DTy9SqF
Migrate the test suite off tape and onto Node's built-in node:test / node:assert so the dev tree no longer carries a third-party test runner, browser harness, linter, or bundler (mirrors the events fork precedent). - test/tape-adapter.js: tape-compatible `t` assertion object backed by node:assert; each tape-style file in test/*.js now requires it instead of 'tape'. Async tests using t.plan()/t.end() are awaited. - test/node/common.js: replace process-exit-based mustCall finalization with an explicit drain (onFinish/drainOnFinish); add hasCrypto/skip. - test/node/index.js: wrap each Node core buffer test in a node:test subtest and drain deferred mustCall checks in a final subtest. - test/index.js: single entrypoint requiring both groups; `npm test` is `node test/index.js` and exits non-zero on failure. - Inline trivial is-buffer/is-nan equivalents in the two test files that used them, so those packages can be dropped. Drop devDependencies used only by the old pipeline: tape, airtap, standard, browserify, uglify-js, benchmark, concat-stream, hyperquest, split, through2. Remove dead scripts (standard, size, perf, perf-node, test-browser-*, update-authors) and the perf/ and bin/ directories they supported. Keep @commitlint/cli and @commitlint/config-conventional. Runtime deps (base64-js, ieee754) and index.js are unchanged. 135 tests pass; installed packages drop from 733 to 77. Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_012QxAK8mJqNntrB9DTy9SqF
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.
Shrinks the heaviest fork's dev tree and thins its CI, per the maintained-fork program.
CI: thin callers of shared reusable workflows
The six existing workflow files are replaced with thin callers of the reusable workflows in
unabandoned/.github, and two security callers are added:ci.yml→reusable-ci(node-versions[20, 22, 24],has-build: false)commitlint.yml,release-please.yml,release-cut.yml,release-security.yml→ their reusable versions (secrets: inheritwhere applicable)publish.yml→reusable-publish(install-for-publish: false,secrets: inherit), withpermissions: id-token: writeset on the calling job for OIDCcodeql.yml,scorecard.yml→ new security callersAll callers pin
uses:at@main. They referenceunabandoned/.githuband will go green once unabandoned/.github#1 merges.Tests: tape → Node's built-in
node:testMigrates the suite off
tapeand ontonode:test/node:assert, following theeventsfork precedent (which solved the same "Node-core tests + tape adapter under node:test" problem).test/tape-adapter.js): a tape-compatibletassertion object backed bynode:assert, implementing everyt.*method used bytest/*.js(equal/strictEqual,deepEqual/same,notEqual,ok/notOk,throws/doesNotThrow,pass/fail,comment,plan,end, …). Async tests that signal completion viat.plan(n)/t.end()are awaited via a promise returned to thenode:testcallback. Eachtest/*.jsnow requires./tape-adapterinstead oftape.test/node/index.js): each upstream Node core buffer test (test/node/test-buffer*.js) is wrapped in anode:testsubtest.test/node/common.jsis adapted the wayevents/tests/common.jswas — theprocess.on('exit')/process.exit(1)mustCallfinalization is replaced with an explicitonFinish/drainOnFinishdrain, and the deferred checks run in a final subtest (not anafter()hook, which would not fail the programmatic runner). AddedhasCrypto = trueso the real crypto-backed assertions run, plus no-opskip/printSkipMessage.test/index.js): requires both groups;npm testis nownode test/index.jsand exits non-zero on any failure.is-buffer/is-nanequivalents in the two test files that used them so those packages can be dropped.Verification:
npm testruns 135 tests (102 tape-style + 33 Node-core subtests including the drain), 0 failures, exit 0. Forced-failure sanity check confirmed both a broken tape-style assertion and a broken Node-core assertion produce a non-zero exit. No test files were skipped or weakened.Dropped dev tree
Removed devDependencies used only by the old tape/browser/lint pipeline:
tape,airtap,standard,browserify,uglify-js,benchmark,concat-stream,hyperquest,split,through2. Removed the now-deadstandard,size,perf,perf-node,test-browser-*, andupdate-authorsscripts, plus theperf/andbin/directories they supported. Kept@commitlint/cliand@commitlint/config-conventional. Runtimedependencies(base64-js,ieee754) andindex.jsare unchanged.Installed packages: 733 → 77 (
npm ls --allnode count 734 → 78 including root).Generated by Claude Code