From ac6316837c82541102dd888e1928595db3561ca4 Mon Sep 17 00:00:00 2001 From: Filip Skokan Date: Fri, 3 Mar 2023 14:50:18 +0100 Subject: [PATCH] wpt: unlock nightly with --no-ignore (#17998) When I was testing the code in #17892 I had updated expectations and didn't catch this. This PR fixes the the expectation file format to not be checked when --no-ignore is passed during [nightly](https://github.com/denoland/deno/actions/runs/4319520368/jobs/7538796572#step:9:46) runs. --- tools/wpt.ts | 14 +++++++++----- tools/wpt/utils.ts | 1 + 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/tools/wpt.ts b/tools/wpt.ts index 2b61682be7..a216e84b0d 100755 --- a/tools/wpt.ts +++ b/tools/wpt.ts @@ -249,8 +249,10 @@ async function generateWptReport( if (!case_.passed) { if (typeof test.expectation === "boolean") { expected = test.expectation ? "PASS" : "FAIL"; - } else { + } else if (Array.isArray(test.expectation)) { expected = test.expectation.includes(case_.name) ? "FAIL" : "PASS"; + } else { + expected = "PASS"; } } @@ -708,10 +710,12 @@ function discoverTestsToRun( } } - assert( - Array.isArray(expectation) || typeof expectation == "boolean", - "test entry must not have a folder expectation", - ); + if (!noIgnore) { + assert( + Array.isArray(expectation) || typeof expectation == "boolean", + "test entry must not have a folder expectation", + ); + } if ( filter && diff --git a/tools/wpt/utils.ts b/tools/wpt/utils.ts index 1752dab041..8aa27a6647 100644 --- a/tools/wpt/utils.ts +++ b/tools/wpt/utils.ts @@ -98,6 +98,7 @@ export function getExpectFailForCase( expectation: boolean | string[], caseName: string, ): boolean { + if (noIgnore) return false; if (typeof expectation == "boolean") { return !expectation; }