1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-22 07:14:47 -05:00

chore(wpt): add "--inspect-brk" flag to WPT runner (#13267)

This commit is contained in:
Sean Michael Wykes 2022-01-06 07:24:37 -03:00 committed by GitHub
parent 2d978a73eb
commit d92072c656
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 14 deletions

View file

@ -20,6 +20,7 @@ import {
getExpectation, getExpectation,
getExpectFailForCase, getExpectFailForCase,
getManifest, getManifest,
inspectBrk,
json, json,
ManifestFolder, ManifestFolder,
ManifestTestOptions, ManifestTestOptions,
@ -161,6 +162,7 @@ async function run() {
test.url, test.url,
test.options, test.options,
createReportTestCase(test.expectation), createReportTestCase(test.expectation),
inspectBrk,
); );
results.push({ test, result }); results.push({ test, result });
reportVariation(result, test.expectation); reportVariation(result, test.expectation);
@ -312,6 +314,7 @@ async function update() {
test.url, test.url,
test.options, test.options,
json ? () => {} : createReportTestCase(test.expectation), json ? () => {} : createReportTestCase(test.expectation),
inspectBrk,
); );
results.push({ test, result }); results.push({ test, result });
reportVariation(result, test.expectation); reportVariation(result, test.expectation);

View file

@ -76,6 +76,7 @@ export async function runSingleTest(
url: URL, url: URL,
_options: ManifestTestOptions, _options: ManifestTestOptions,
reporter: (result: TestCaseResult) => void, reporter: (result: TestCaseResult) => void,
inspectBrk: boolean,
): Promise<TestResult> { ): Promise<TestResult> {
const bundle = await generateBundle(url); const bundle = await generateBundle(url);
const tempFile = await Deno.makeTempFile({ const tempFile = await Deno.makeTempFile({
@ -88,12 +89,21 @@ export async function runSingleTest(
const startTime = new Date().getTime(); const startTime = new Date().getTime();
const proc = Deno.run({ const cmd = [
cmd: [
denoBinary(), denoBinary(),
"run", "run",
];
cmd.push(
"-A", "-A",
"--unstable", "--unstable",
);
if (inspectBrk) {
cmd.push("--inspect-brk");
}
cmd.push(
"--enable-testing-features-do-not-use", "--enable-testing-features-do-not-use",
"--location", "--location",
url.toString(), url.toString(),
@ -101,7 +111,10 @@ export async function runSingleTest(
join(ROOT_PATH, `./tools/wpt/certs/cacert.pem`), join(ROOT_PATH, `./tools/wpt/certs/cacert.pem`),
tempFile, tempFile,
"[]", "[]",
], );
const proc = Deno.run({
cmd,
env: { env: {
NO_COLOR: "1", NO_COLOR: "1",
}, },

View file

@ -12,10 +12,11 @@ export const {
rebuild, rebuild,
["--"]: rest, ["--"]: rest,
["auto-config"]: autoConfig, ["auto-config"]: autoConfig,
["inspect-brk"]: inspectBrk,
binary, binary,
} = parse(Deno.args, { } = parse(Deno.args, {
"--": true, "--": true,
boolean: ["quiet", "release", "no-interactive"], boolean: ["quiet", "release", "no-interactive", "inspect-brk"],
string: ["json", "wptreport", "binary"], string: ["json", "wptreport", "binary"],
}); });