From 904b8f3ed231f14a0cab2e65ac8adcded3275d73 Mon Sep 17 00:00:00 2001 From: Khafra Date: Tue, 16 Jan 2024 11:38:02 -0500 Subject: [PATCH] exit with 1 if WPT runner has unexpected errors (#2621) * exit with 1 if WPT runner has unexpected errors * fixup * fixup * fixup * Update test/wpt/runner/runner.mjs Co-authored-by: Filip Skokan --------- Co-authored-by: Filip Skokan --- test/wpt/runner/runner.mjs | 2 +- test/wpt/runner/worker.mjs | 9 +++++++++ test/wpt/status/fetch.status.json | 13 ++++++++++++- 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/test/wpt/runner/runner.mjs b/test/wpt/runner/runner.mjs index 5bec326d3e1..a97b72377f7 100644 --- a/test/wpt/runner/runner.mjs +++ b/test/wpt/runner/runner.mjs @@ -313,7 +313,7 @@ export class WPTRunner extends EventEmitter { `skipped: ${skipped}` ) - process.exit(0) + process.exit(failed - expectedFailures ? 1 : process.exitCode) } addInitScript (code) { diff --git a/test/wpt/runner/worker.mjs b/test/wpt/runner/worker.mjs index 90bfcf6dbde..961c1343a66 100644 --- a/test/wpt/runner/worker.mjs +++ b/test/wpt/runner/worker.mjs @@ -12,6 +12,7 @@ import { WebSocket } from '../../../lib/websocket/websocket.js' import { Cache } from '../../../lib/cache/cache.js' import { CacheStorage } from '../../../lib/cache/cachestorage.js' import { kConstruct } from '../../../lib/cache/symbols.js' +import { webcrypto } from 'node:crypto' const { initScripts, meta, test, url, path } = workerData @@ -92,6 +93,14 @@ Object.defineProperties(globalThis, { } }) +// TODO: remove once node 18 is dropped +if (!globalThis.crypto) { + Object.defineProperty(globalThis, 'crypto', { + ...globalPropertyDescriptors, + value: webcrypto + }) +} + // self is required by testharness // GLOBAL is required by self runInThisContext(` diff --git a/test/wpt/status/fetch.status.json b/test/wpt/status/fetch.status.json index 29dcecd2810..860e053b3c5 100644 --- a/test/wpt/status/fetch.status.json +++ b/test/wpt/status/fetch.status.json @@ -92,9 +92,14 @@ "skip": true }, "scheme-blob.sub.any.js": { - "note": "fails everywhere", + "note": "fail: fails everywhere, flaky: only node 18", "fail": [ "Fetching URL.createObjectURL(invalid_type_blob) is OK" + ], + "flaky": [ + "Fetching URL.createObjectURL(empty_blob) is OK", + "Fetching URL.createObjectURL(empty_type_blob) is OK", + "Fetching URL.createObjectURL(empty_data_blob) is OK" ] }, "status.h2.any.js": { @@ -417,6 +422,12 @@ "note": "this is a bug in webstreams, see https://github.com/nodejs/node/issues/46786", "skip": true } + }, + "idlharness.any.js": { + "note": "https://github.com/nodejs/undici/issues/1666#issuecomment-1275177704", + "fail": [ + "Window interface: operation fetch(RequestInfo, optional RequestInit)" + ] } }, "content-length": {