Skip to content

test(node-core): enrich common shim to raise the #800 radar denominator#1754

Merged
proggeramlug merged 1 commit into
mainfrom
chore/node-core-shim-enrich
May 25, 2026
Merged

test(node-core): enrich common shim to raise the #800 radar denominator#1754
proggeramlug merged 1 commit into
mainfrom
chore/node-core-shim-enrich

Conversation

@proggeramlug
Copy link
Copy Markdown
Contributor

Tooling-only follow-up to the #800 radar (test-compat/node-core). No compiler change.

What

Node's test/parallel cases require('../common'); the radar stages a Perry-compilable shim in its place. When a test uses a common.* helper the shim doesn't export, it throws under both Node-with-shim and Perry → the case lands in node-skip and is excluded from the judged set, shrinking the denominator.

This adds the helpers our in-scope corpus actually uses (counted by frequency across the supported APIs):

  • expectsError (51 uses) — validator for assert.throws(fn, common.expectsError({code,...}))
  • getArrayBufferViews / getBufferSources — TypedArray/DataView views over a Buffer (buffer tests)
  • canCreateSymLink, printSkipMessage, skipIf, runWithInvalidFD, escapePOSIXShell, expectWarning (no-op)
  • build flags: isIBMi, isDebug, isASan, isPi, hasOpenSSL3, hasQuic, hasSQLite

Measured impact

On the 10 pure-logic APIs (path/querystring/string_decoder/url/util/assert/buffer/events/os/timers), combined with vendoring test/fixtures: node-skip 41 → 37, judged 71 → 75. Modest — most remaining node-skips are v22-corpus-under-host-v25 drift (e.g. test-util-callbackify deep-equal mismatch, test-url-parse-format using node:test), which the shim can't fix. The real denominator lever there is aligning the vendored corpus version with the host Node (pinned-version.txt) — left as a separate decision on what version "parity" targets.

Validated: shim loads + helpers behave under Node (expectsError validates, getArrayBufferViews → 10 views).

Adds the most-used common helpers our shim was missing (so tests load under
both runtimes instead of node-skipping on `common.X is not a function`):
expectsError (51 uses across in-scope tests), getArrayBufferViews,
getBufferSources, canCreateSymLink, printSkipMessage, skipIf, expectWarning
(no-op), runWithInvalidFD, escapePOSIXShell, plus build flags (isIBMi,
isDebug, isASan, isPi, hasOpenSSL3, hasQuic, hasSQLite).

Measured on the 10 pure-logic APIs: node-skip 41->37, judged 71->75.
(The bulk of remaining node-skips are v22-corpus-under-host-v25 drift, not
shim gaps — that's a separate version-alignment call.)
@proggeramlug proggeramlug merged commit e45f241 into main May 25, 2026
10 checks passed
@proggeramlug proggeramlug deleted the chore/node-core-shim-enrich branch May 25, 2026 06:31
proggeramlug added a commit that referenced this pull request May 25, 2026
7 PRs landed on main after the v0.5.1027 bump (50c391f) without
per-PR tags. Neither v0.5.1026 nor v0.5.1027 were tagged on the
remote — v0.5.1028 is the first tag in this window.

- #1738 feat(compile): --trace/--focus debugging flags.
- #1723/#1741 fix(lockdown): #503 ns[dynamicKey].staticMember.
- #1673/#1742 fix(dynamic-import): literal node: builtin specifier.
- #1724/#1747 fix(node): Blob/URL globals trigger http-client feature.
- #1728/#1749 fix(node:path): win32 normalize/basename/toNamespacedPath.
- #1751 test(parity): stream consumers/promises/static batch.
- #1754 test(node-core): enrich common shim for #800.
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