diff options
author | Sean Michael Wykes <8363933+SeanWykes@users.noreply.github.com> | 2022-01-06 07:24:37 -0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-06 11:24:37 +0100 |
commit | d92072c656ac0e764c1588ad5825ce6a10703352 (patch) | |
tree | e2cf9c26764e73c4d4dbc2a3e7ac7e51f4dae46e | |
parent | 2d978a73ebc68d67672fca4df9afb8ab01fcc4f8 (diff) |
chore(wpt): add "--inspect-brk" flag to WPT runner (#13267)
-rwxr-xr-x | tools/wpt.ts | 3 | ||||
-rw-r--r-- | tools/wpt/runner.ts | 39 | ||||
-rw-r--r-- | tools/wpt/utils.ts | 3 |
3 files changed, 31 insertions, 14 deletions
diff --git a/tools/wpt.ts b/tools/wpt.ts index d56ff34d6..b582219fa 100755 --- a/tools/wpt.ts +++ b/tools/wpt.ts @@ -20,6 +20,7 @@ import { getExpectation, getExpectFailForCase, getManifest, + inspectBrk, json, ManifestFolder, ManifestTestOptions, @@ -161,6 +162,7 @@ async function run() { test.url, test.options, createReportTestCase(test.expectation), + inspectBrk, ); results.push({ test, result }); reportVariation(result, test.expectation); @@ -312,6 +314,7 @@ async function update() { test.url, test.options, json ? () => {} : createReportTestCase(test.expectation), + inspectBrk, ); results.push({ test, result }); reportVariation(result, test.expectation); diff --git a/tools/wpt/runner.ts b/tools/wpt/runner.ts index 4f4389fd3..b7a51af9d 100644 --- a/tools/wpt/runner.ts +++ b/tools/wpt/runner.ts @@ -76,6 +76,7 @@ export async function runSingleTest( url: URL, _options: ManifestTestOptions, reporter: (result: TestCaseResult) => void, + inspectBrk: boolean, ): Promise<TestResult> { const bundle = await generateBundle(url); const tempFile = await Deno.makeTempFile({ @@ -88,20 +89,32 @@ export async function runSingleTest( const startTime = new Date().getTime(); + const cmd = [ + denoBinary(), + "run", + ]; + + cmd.push( + "-A", + "--unstable", + ); + + if (inspectBrk) { + cmd.push("--inspect-brk"); + } + + cmd.push( + "--enable-testing-features-do-not-use", + "--location", + url.toString(), + "--cert", + join(ROOT_PATH, `./tools/wpt/certs/cacert.pem`), + tempFile, + "[]", + ); + const proc = Deno.run({ - cmd: [ - denoBinary(), - "run", - "-A", - "--unstable", - "--enable-testing-features-do-not-use", - "--location", - url.toString(), - "--cert", - join(ROOT_PATH, `./tools/wpt/certs/cacert.pem`), - tempFile, - "[]", - ], + cmd, env: { NO_COLOR: "1", }, diff --git a/tools/wpt/utils.ts b/tools/wpt/utils.ts index 1a7a682be..a5e762527 100644 --- a/tools/wpt/utils.ts +++ b/tools/wpt/utils.ts @@ -12,10 +12,11 @@ export const { rebuild, ["--"]: rest, ["auto-config"]: autoConfig, + ["inspect-brk"]: inspectBrk, binary, } = parse(Deno.args, { "--": true, - boolean: ["quiet", "release", "no-interactive"], + boolean: ["quiet", "release", "no-interactive", "inspect-brk"], string: ["json", "wptreport", "binary"], }); |