Skip to content

test: remove two duplicate smoke tests - #890

Merged
Brooooooklyn merged 2 commits into
mainfrom
claude/prune-tests-duplicate-smoke-tests
Oct 26, 2026
Merged

Brooooooklyn merged 2 commits into
mainfrom
claude/prune-tests-duplicate-smoke-tests

Conversation

@Brooooooklyn

Copy link
Copy Markdown
Member

Requested by Brooklyn · project thread

Before: two smoke tests could not fail for a reason no other test catches. integrate-vitest's index.spec.ts > transform repeats integrate-module's should resolve native addon, and integrate-module's named import from json asserts on a JSON import that Node loads natively, so it passes even when oxc-node's JSON loader is broken.

After: both are gone. The two stdin TTY tests that alone catch a TTY regression now say so in a comment, and a comment that pointed at the deleted spec points at the surviving test. Only test files change.

How: each removal was defended by mutating src/lib.rs with the most realistic regression it could catch, rebuilding the addon, running all three JS suites, and reverting.

Totals

  • Files touched: 4, all tests (1 deleted, 1 case removed, 2 comment-only).
  • Cases deleted: 2 of 643 JS cases (Vitest 600, integrate-module 21, integrate-module-bundler 22); after: 641. The Rust #[test]s are untouched.
  • Cases merged: 0.
  • Net lines: −7 (+6 / −13).
  • Runtime saved: 9.8 ms, the summed duration of the removed cases (transform 9.72 ms, named import from json 0.09 ms).

Removals

  1. packages/integrate-vitest/__tests__/index.spec.ts > transform (whole file)
    • Class: duplicate. It calls new OxcTransformer(process.cwd()).transformAsync("foo.ts", …) and checks the CommonJS output; packages/integrate-module/src/index.ts > should resolve native addon does the same with "index.ts".
    • Mutation M4: src/lib.rs TransformTask::compute emits Module::Esm instead of Module::CommonJS. Fails both this test and should resolve native addon.
    • Still covered by should resolve native addon.
  2. packages/integrate-module/src/index.ts > named import from json
    • Class: cannot fail when the product breaks. import pkgJson from "../package.json" with { type: "json" } is loaded by Node itself, not by oxc-node's JSON loader, and the test only reads pkgJson.version, a default-export property.
    • Mutation M5: src/lib.rs JSON loader emits export default {}. 9 json-modules / percent-encoded Vitest cases fail; all of integrate-module, including this test, passes.
    • Mutation M3: the JSON loader drops the synthesised named exports. json-modules.spec.ts > a named import and > a paths alias keeps the synthesised named exports fail; this test passes.
    • The original feature (feat: support named import from json #20, named JSON imports) stays covered by those two json-modules.spec.ts cases; resolve package.json keeps the import itself exercised.

Kept after defense

  • stdin-tty.spec.ts > CLI preserves TTY properties when stdin is a TTY and > CLI with node directly preserves TTY (baseline comparison). Mutation M6, process.stdin.isTTY = false; at the top of packages/core/register.mjs, fails only these two across all three suites (re-run on this branch). Each now carries a comment saying so.

Case counts

suite before after delta
integrate-vitest (Vitest) 600 (581 passed, 19 skipped) 599 (580 passed, 19 skipped) −1
integrate-module 21 20 −1
integrate-module-bundler 22 22 0

0 failures before and after.

What ran and what did not

  • Ran: all three JS suites at 6d5376d and on this branch; mutations M3, M4, M5 (with an addon rebuild each) and M6, each reverted afterwards; vp check --no-fmt (lint and type-check, clean on 99 files); vp fmt --check on the touched files (clean).
  • vp check reports a formatting issue in lerna.json; it reports the same at 6d5376d, and this PR does not touch that file.
  • Not run: the Rust tests, the bench, the WASI build, and other platforms.

Ages: transform dates from before #663 (2026-07-04); named import from json from #20 (2024-07-18). Neither is in a permission or security suite.

To revert: git revert 80ceedd.


Generated by Claude Code

`integrate-vitest/__tests__/index.spec.ts > transform` repeats integrate-module's
`should resolve native addon` (same API, same CommonJS output). `named import
from json` in integrate-module asserts on a JSON import that Node loads natively,
so it cannot fail when oxc-node's JSON loader breaks; json-modules.spec.ts
covers named JSON imports.

Also note why the two stdin TTY tests are kept, and repoint a comment that
referred to the deleted spec.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01PxVsmvB9xfZKfVnUonY8kf
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-24T19:27:47.219255Z 80ceedd PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@Brooooooklyn
Brooooooklyn merged commit b5af674 into main Oct 26, 2026
67 checks passed
@Brooooooklyn
Brooooooklyn deleted the claude/prune-tests-duplicate-smoke-tests branch October 26, 2026 05:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants