Skip to content

Commit

Permalink
wpt: unlock nightly with --no-ignore (#17998)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
panva committed Mar 3, 2023
1 parent 38555a6 commit 1b42ab4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
14 changes: 9 additions & 5 deletions tools/wpt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
}

Expand Down Expand Up @@ -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 &&
Expand Down
1 change: 1 addition & 0 deletions tools/wpt/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 98,7 @@ export function getExpectFailForCase(
expectation: boolean | string[],
caseName: string,
): boolean {
if (noIgnore) return false;
if (typeof expectation == "boolean") {
return !expectation;
}
Expand Down

0 comments on commit 1b42ab4

Please sign in to comment.