-
Notifications
You must be signed in to change notification settings - Fork 5k
test: derive process.versions expectations from scripts/build/deps #29295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Jarred-Sumner
wants to merge
8
commits into
main
Choose a base branch
from
claude/process-versions-test-reads-deps
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+26
−16
Open
Changes from 2 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
7f62155
test: read process.versions expected hashes from scripts/build/deps
Jarred-Sumner a0e2daa
Merge branch 'main' into claude/process-versions-test-reads-deps
Jarred-Sumner f4f505b
Merge branch 'main' into claude/process-versions-test-reads-deps
robobun 0669227
Merge branch 'main' into claude/process-versions-test-reads-deps
robobun 6ccd42b
Merge branch 'main' into claude/process-versions-test-reads-deps
robobun 4e044ec
Merge branch 'main' into claude/process-versions-test-reads-deps
robobun 9dceade
Merge branch 'main' into claude/process-versions-test-reads-deps
robobun 45977f9
Merge branch 'main' into claude/process-versions-test-reads-deps
robobun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🟡 The file now has two it("process.versions", ...) blocks with identical names — the new one at line 271 (reads dep commit hashes from scripts/build/deps/*.ts) and a pre-existing one at line 1186 (checks hardcoded node/v8/napi/modules strings). Both run when filtering with -t "^process.versions$", producing duplicate names in test reports and making it harder to tell which assertion failed. Consider renaming the new block to "process.versions (dep commits)" and the old one to "process.versions (node metadata)" to distinguish the two concerns.
Extended reasoning...
What the bug is and how it manifests
The file test/js/node/process/process.test.js has two it() blocks both named "process.versions". The first (line 271, modified by this PR) is an async test that reads each pinned commit from scripts/build/deps/.ts and asserts it matches process.versions[key]. The second (line 1186, pre-existing) is a synchronous test that asserts hardcoded string values for process.versions.node, .v8, .napi, and .modules. Both tests are structurally valid and pass, but they share the same name.
The specific code path that triggers it
The PR description explicitly calls out: USE_SYSTEM_BUN=1 bun test ... -t "^process.versions$" — fails. That filter matches both blocks. Bun's test runner runs every it() whose name matches the regex, so both execute under the filter, and both appear in CI/terminal output with the identical label "process.versions".
Why existing code does not prevent it
Test frameworks (including Bun's) do not enforce unique it() names within a file or suite. The duplicate was present before this PR (confirmed in commit edde070); the PR modified the first block to switch from hardcoded hashes to dynamically derived ones, but kept the name "process.versions" unchanged.
Impact
When one of the two tests fails, the output shows a failure for "process.versions" without indicating which of the two distinct concerns failed. Anyone reading CI logs or filtering with -t would run both tests and see two results under the same label — making debugging needlessly confusing.
How to fix it
Rename one or both tests to reflect what they actually verify:
Step-by-step proof