Skip to content

Commit

Permalink
exit with 1 if WPT runner has unexpected errors (nodejs#2621)
Browse files Browse the repository at this point in the history
* exit with 1 if WPT runner has unexpected errors

* fixup

* fixup

* fixup

* Update test/wpt/runner/runner.mjs

Co-authored-by: Filip Skokan <panva.ip@gmail.com>

---------

Co-authored-by: Filip Skokan <panva.ip@gmail.com>
  • Loading branch information
2 people authored and crysmags committed Feb 27, 2024
1 parent 9ec63f7 commit 9b5673d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/wpt/runner/runner.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ export class WPTRunner extends EventEmitter {
`skipped: ${skipped}`
)

process.exit(0)
process.exit(failed - expectedFailures ? 1 : process.exitCode)
}

addInitScript (code) {
Expand Down
9 changes: 9 additions & 0 deletions test/wpt/runner/worker.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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(`
Expand Down
13 changes: 12 additions & 1 deletion test/wpt/status/fetch.status.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -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": {
Expand Down

0 comments on commit 9b5673d

Please sign in to comment.