Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions browser-specific-failures.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,37 @@ flags.defineBoolean('experimental', false,
'Calculate metrics for experimental runs.');
flags.parse();

// WPT result paths to exclude from browser-specific-failure scoring.
// /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.
const EXCLUDED_PATHS = ['/third_party/test262'];

// Returns a copy of |tree| with any subtrees whose path appears in
// |excludedPaths| removed. Subtrees not on a path to an excluded entry are
// shared by reference (no deep copy), so the operation is cheap.
function pruneExcludedPaths(tree, excludedPaths, currentPath = '') {
const relevant = excludedPaths.filter(p =>
p.startsWith(currentPath + '/'));
if (relevant.length === 0) {
return tree;
}

const newTrees = {};
for (const [name, child] of Object.entries(tree.trees)) {
const childPath = `${currentPath}/${name}`;
if (relevant.includes(childPath)) {
continue;
}
newTrees[name] = relevant.some(p => p.startsWith(childPath + '/')) ?
pruneExcludedPaths(child, relevant, childPath) :
child;
}
return {...tree, trees: newTrees};
}


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