Skip to content

Commit 1d7d474

Browse files
committed
Simplify test names
1 parent 9b15ff0 commit 1d7d474

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

tests/baseline.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

tests/wpt.ts

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ const SAFARI_MACOS_DEFINITION: BrowserDefinition = {
175175
const EDGE_DEFINITION: BrowserDefinition = {
176176
name: 'Edge',
177177
logo: 'https://unpkg.com/@browser-logos/edge@2.0.5/edge.svg',
178-
versions: Array.from({length: 104 - 104/*80*/})
178+
versions: Array.from({length: 104 - 104 /*80*/})
179179
.map((_, i) => 80 + i)
180180
.filter(version => ![82].includes(version))
181181
.map(version => `${version}.0`)
@@ -198,7 +198,7 @@ const EDGE_DEFINITION: BrowserDefinition = {
198198
const FIREFOX_DEFINITION: BrowserDefinition = {
199199
name: 'Firefox',
200200
logo: 'https://unpkg.com/@browser-logos/firefox@3.0.9/firefox.svg',
201-
versions: Array.from({length: 103 - 103/*69*/})
201+
versions: Array.from({length: 103 - 103 /*69*/})
202202
.map((_, i) => 69 + i)
203203
.map(version => `${version}.0`)
204204
.map(browserVersion => ({
@@ -412,12 +412,13 @@ async function main() {
412412
const failed: TestDescriptor[] = [];
413413

414414
for (const test of results) {
415+
const testURL = new URL(test[0]);
415416
if (Array.isArray(test) && Array.isArray(test[1].tests)) {
416417
for (const subtest of test[1].tests) {
417418
if (SUBTEST_FILTERS.some(filter => filter.test(subtest.name))) {
418419
continue;
419420
}
420-
const result = {test: test[0], subtest: subtest.name};
421+
const result = {test: testURL.pathname, subtest: subtest.name};
421422
const destination =
422423
subtest.status === subtest.PASS ? passed : failed;
423424

@@ -445,7 +446,10 @@ async function main() {
445446
}
446447

447448
interface SubtestMap {
448-
[key: string]: string[];
449+
[key: string]: {
450+
passed: string[];
451+
failed: string[];
452+
};
449453
}
450454

451455
function getTargetResultBucket(
@@ -454,8 +458,9 @@ async function main() {
454458
) {
455459
const testToSubtest = (testToSubtestMap[descriptor.test] =
456460
testToSubtestMap[descriptor.test] || {});
457-
const subtestToBucket = (testToSubtest[descriptor.subtest] =
458-
testToSubtest[descriptor.subtest] || []);
461+
const subtestToBucket = (testToSubtest[descriptor.subtest] = testToSubtest[
462+
descriptor.subtest
463+
] || {passed: [], failed: []});
459464

460465
testToSubtestMap[descriptor.test] = testToSubtest;
461466
testToSubtest[descriptor.subtest] = subtestToBucket;
@@ -472,12 +477,12 @@ async function main() {
472477

473478
for (const result of passed) {
474479
const bucket = getTargetResultBucket(testToSubtests, result);
475-
bucket.push(name);
480+
bucket.passed.push(name);
476481
}
477482

478483
for (const result of failed) {
479484
const bucket = getTargetResultBucket(testToSubtests, result);
480-
bucket.push(name);
485+
bucket.failed.push(name);
481486
}
482487
}
483488
}

0 commit comments

Comments
 (0)