ci: run node tests directly instead of translated files (#15565)

Co-authored-by: nektro <nektro@users.noreply.github.com>
This commit is contained in:
Meghan Denny
2024-12-03 22:10:50 -08:00
committed by GitHub
parent 0d5e4e162b
commit 23299dadf6
1894 changed files with 51198 additions and 45553 deletions

View File

@@ -28,9 +28,11 @@ import {
getEnv,
getFileUrl,
getWindowsExitReason,
isArm64,
isBuildkite,
isCI,
isGithubAction,
isMacOS,
isWindows,
printEnvironment,
startGroup,
@@ -206,6 +208,31 @@ async function runTests() {
if (results.every(({ ok }) => ok)) {
for (const testPath of tests) {
const title = relative(cwd, join(testsPath, testPath)).replace(/\\/g, "/");
if (title.startsWith("test/js/node/test/parallel/")) {
await runTest(title, async () => {
const { ok, error, stdout } = await spawnBun(execPath, {
cwd: cwd,
args: [title],
timeout: spawnTimeout,
env: {
FORCE_COLOR: "0",
},
stdout: chunk => pipeTestStdout(process.stdout, chunk),
stderr: chunk => pipeTestStdout(process.stderr, chunk),
});
return {
testPath: title,
ok,
status: ok ? "pass" : "fail",
error,
errors: [],
tests: [],
stdout,
stdoutPreview: "",
};
});
continue;
}
await runTest(title, async () => spawnBunTest(execPath, join("test", testPath)));
}
}
@@ -770,7 +797,7 @@ function isJavaScriptTest(path) {
* @returns {boolean}
*/
function isTest(path) {
if (path.replaceAll(sep, "/").includes("/test-cluster-") && path.endsWith(".js")) return true;
if (path.startsWith("js/node/test/parallel/") && isMacOS && isArm64) return true;
if (path.replaceAll(sep, "/").startsWith("js/node/cluster/test-") && path.endsWith(".ts")) return true;
return isTestStrict(path);
}