Skip to content

Commit 11377ff

Browse files
committed
Skip /third_party/test262/ when computing browser-specific failures
/third_party/test262/ introduces Temporal tests as individual tests instead of using the subtest WPT convention. These test failtures misrepresent the overal interoperability of the web by causing the single browser failure graph to be completely dominated by a feature not yet shipped by all browsers.
1 parent 0f777f2 commit 11377ff

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

browser-specific-failures.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,37 @@ flags.defineBoolean('experimental', false,
2323
'Calculate metrics for experimental runs.');
2424
flags.parse();
2525

26+
// WPT result paths to exclude from browser-specific-failure scoring.
27+
// /third_party/test262/ introduces Temporal tests as individual tests
28+
// instead of using the subtest WPT convention. These test failtures
29+
// misrepresent the overal interoperability of the web by causing the
30+
// single browser failure graph to be completely dominated by a feature
31+
// not yet shipped by all browsers.
32+
const EXCLUDED_PATHS = ['/third_party/test262'];
33+
34+
// Returns a copy of |tree| with any subtrees whose path appears in
35+
// |excludedPaths| removed. Subtrees not on a path to an excluded entry are
36+
// shared by reference (no deep copy), so the operation is cheap.
37+
function pruneExcludedPaths(tree, excludedPaths, currentPath = '') {
38+
const relevant = excludedPaths.filter(p =>
39+
p.startsWith(currentPath + '/'));
40+
if (relevant.length === 0) {
41+
return tree;
42+
}
43+
44+
const newTrees = {};
45+
for (const [name, child] of Object.entries(tree.trees)) {
46+
const childPath = `${currentPath}/${name}`;
47+
if (relevant.includes(childPath)) {
48+
continue;
49+
}
50+
newTrees[name] = relevant.some(p => p.startsWith(childPath + '/')) ?
51+
pruneExcludedPaths(child, relevant, childPath) :
52+
child;
53+
}
54+
return {...tree, trees: newTrees};
55+
}
56+
2657

2758
async function main() {
2859
// Sort the products so that output files are consistent.
@@ -78,6 +109,7 @@ async function main() {
78109
throw new Error('Run JSON contains "tree" field; code needs changed.');
79110
}
80111
run.tree = await lib.results.getGitTree(repo, run);
112+
run.tree = pruneExcludedPaths(run.tree, EXCLUDED_PATHS);
81113
}
82114
}
83115
after = Date.now();

0 commit comments

Comments
 (0)