-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
test: migrate message v8 tests from Python to JS #50421
Merged
nodejs-github-bot
merged 2 commits into
nodejs:main
from
jahjahLemonade:jl-test-message-v8
Oct 29, 2023
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
'use strict'; | ||
|
||
require('../common'); | ||
require('../../common'); | ||
|
||
function AsmModule() { | ||
'use asm'; | ||
|
File renamed without changes.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import '../common/index.mjs'; | ||
import * as fixtures from '../common/fixtures.mjs'; | ||
import * as snapshot from '../common/assertSnapshot.js'; | ||
import { describe, it } from 'node:test'; | ||
|
||
function replaceNodeVersion(str) { | ||
return str.replaceAll(process.version, '*'); | ||
} | ||
|
||
describe('v8 output', { concurrency: true }, () => { | ||
function normalize(str) { | ||
return str.replaceAll(snapshot.replaceWindowsPaths(process.cwd()), '') | ||
.replaceAll(/:\d+/g, ':*') | ||
.replaceAll('/', '*') | ||
.replaceAll('*test*', '*') | ||
.replaceAll('*fixtures*v8*', '*') | ||
.replaceAll('node --', '* --'); | ||
} | ||
const common = snapshot | ||
.transform(snapshot.replaceWindowsLineEndings, snapshot.replaceWindowsPaths, replaceNodeVersion); | ||
const defaultTransform = snapshot.transform(common, normalize); | ||
const tests = [ | ||
{ name: 'v8/v8_warning.js' }, | ||
]; | ||
for (const { name, transform } of tests) { | ||
jahjahLemonade marked this conversation as resolved.
Show resolved
Hide resolved
|
||
it(name, async () => { | ||
await snapshot.spawnAndAssert(fixtures.path(name), transform ?? defaultTransform); | ||
}); | ||
} | ||
}); |
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.
@MoLow @jahjahLemonade the idea here was to make this generic because Electron (and perhaps some other embedders) run these tests with a different executable name (in our case, of course, Electron). As this stands, it fails for the same reason the
*
was initially added, unintentionally defeating its purpose. We're hitting this now as we upgrade Node.js versions to 20.11.0, which is why this comment is a little delayed 😅I'd like to try to find a solution for some of these snapshots that's ideally a bit less brittle, given the previous python approach seemed much more flexible and easier to make more or less specific in its comparisons.