Merge pull request #313982 from aduh95/nodejs-jstest

nodejs: run JS test suite as part of the checks
This commit is contained in:
Linus Heckemann
2024-05-31 17:34:33 +02:00
committed by GitHub
5 changed files with 50 additions and 5 deletions
+8 -2
View File
@@ -137,10 +137,16 @@ let
"build-node-api-tests"
"tooltest"
"cctest"
"test-ci-js"
];
# Do not create __pycache__ when running tests.
checkFlags = [ "PYTHONDONTWRITEBYTECODE=1" ];
checkFlags = [
# Do not create __pycache__ when running tests.
"PYTHONDONTWRITEBYTECODE=1"
"FLAKY_TESTS=skip"
# Skip some tests that are not passing in this context
"CI_SKIP_TESTS=test-setproctitle,test-tls-cli-max-version-1.3,test-tls-client-auth,test-child-process-exec-env,test-fs-write-stream-eagain,test-tls-sni-option,test-https-foafssl,test-child-process-uid-gid,test-process-euid-egid,test-process-initgroups,test-process-uid-gid,test-process-setgroups"
];
postInstall = ''
HOST_PATH=$out/bin patchShebangs --host $out
@@ -0,0 +1,24 @@
`/usr/bin/env` is not available.
--- old/test/common/assertSnapshot.js
+++ new/test/common/assertSnapshot.js
@@ -81,2 +81,2 @@ async function spawnAndAssert(filename, transform = (x) => x, { tty = false, ...
- const executable = tty ? 'tools/pseudo-tty.py' : process.execPath;
- const args = tty ? [process.execPath, ...flags, filename] : [...flags, filename];
+ const executable = tty ? 'python3' : process.execPath;
+ const args = tty ? ['tools/pseudo-tty.py', process.execPath, ...flags, filename] : [...flags, filename];
--- old/test/parallel/test-child-process-default-options.js
+++ new/test/parallel/test-child-process-default-options.js
@@ -35 +35 @@ if (isWindows) {
- child = spawn('/usr/bin/env', [], {});
+ child = spawn('env', [], {});
--- old/test/parallel/test-child-process-env.js
+++ new/test/parallel/test-child-process-env.js
@@ -51 +51 @@ if (isWindows) {
- child = spawn('/usr/bin/env', [], { env });
+ child = spawn('env', [], { env });
--- old/test/parallel/test-child-process-exec-env.js
+++ new/test/parallel/test-child-process-exec-env.js
@@ -47 +47 @@ if (!isWindows) {
- child = exec('/usr/bin/env', { env: { 'HELLO': 'WORLD' } }, after);
+ child = exec('env', { env: { 'HELLO': 'WORLD' } }, after);
+6 -1
View File
@@ -1,4 +1,4 @@
{ callPackage, lib, overrideCC, pkgs, buildPackages, openssl, python3, enableNpm ? true }:
{ callPackage, lib, overrideCC, pkgs, buildPackages, openssl, python3, fetchpatch2, enableNpm ? true }:
let
# Clang 16+ cannot build Node v18 due to -Wenum-constexpr-conversion errors.
@@ -27,5 +27,10 @@ buildNodejs {
./revert-arm64-pointer-auth.patch
./node-npm-build-npm-package-logic.patch
./trap-handler-backport.patch
./use-correct-env-in-tests.patch
(fetchpatch2 {
url = "https://github.com/nodejs/node/commit/534c122de166cb6464b489f3e6a9a544ceb1c913.patch";
hash = "sha256-4q4LFsq4yU1xRwNsM1sJoNVphJCnxaVe2IyL6AeHJ/I=";
})
];
}
+6 -1
View File
@@ -1,4 +1,4 @@
{ callPackage, openssl, python3, enableNpm ? true }:
{ callPackage, fetchpatch2, openssl, python3, enableNpm ? true }:
let
buildNodejs = callPackage ./nodejs.nix {
@@ -15,5 +15,10 @@ buildNodejs {
./disable-darwin-v8-system-instrumentation-node19.patch
./bypass-darwin-xcrun-node16.patch
./node-npm-build-npm-package-logic.patch
./use-correct-env-in-tests.patch
(fetchpatch2 {
url = "https://github.com/nodejs/node/commit/534c122de166cb6464b489f3e6a9a544ceb1c913.patch";
hash = "sha256-4q4LFsq4yU1xRwNsM1sJoNVphJCnxaVe2IyL6AeHJ/I=";
})
];
}
+6 -1
View File
@@ -1,4 +1,4 @@
{ callPackage, openssl, python3, enableNpm ? true }:
{ callPackage, fetchpatch2, openssl, python3, enableNpm ? true }:
let
buildNodejs = callPackage ./nodejs.nix {
@@ -14,5 +14,10 @@ buildNodejs {
./disable-darwin-v8-system-instrumentation-node19.patch
./bypass-darwin-xcrun-node16.patch
./node-npm-build-npm-package-logic.patch
./use-correct-env-in-tests.patch
(fetchpatch2 {
url = "https://github.com/nodejs/node/commit/534c122de166cb6464b489f3e6a9a544ceb1c913.patch";
hash = "sha256-4q4LFsq4yU1xRwNsM1sJoNVphJCnxaVe2IyL6AeHJ/I=";
})
];
}