Skip to content

Instantly share code, notes, and snippets.

@felipc
Created December 17, 2015 23:21
Show Gist options
  • Save felipc/18e9416c82be5fce1010 to your computer and use it in GitHub Desktop.
Save felipc/18e9416c82be5fce1010 to your computer and use it in GitHub Desktop.
Run this to generate a list of tests that are skipped on e10s. Adjust objdir and srcdir accordingly.
"use strict";
const path = require("path");
const fs = require('fs');
const objdir = "/Users/felipe/moz/mozilla-central/ff-opt/";
const srcdir = "/Users/felipe/moz/mozilla-central/mozilla/";
const flavor = process.argv[2] || "browser-chrome";
console.log("Disabled " + flavor + " tests:\n");
/* skipped
mochitest-plain:
dom/browser-element/mochitest/mochitest-oop.ini
dom/canvas/test/_webgl-conformance.ini
dom/browser-element/mochitest/mochitest.ini
*/
/*
possible flavors (and their total counts as of 2015-12-15 are:
reftest: 19220
web-platform-tests: 5973
crashtest: 2934
browser-chrome: 3014
mochitest: 6384
xpcshell: 2816
chrome: 1270
a11y: 288
jetpack-addon: 40
jetpack-package: 142
webapprt-chrome: 16
webapprt-content: 2
*/
let allTests = JSON.parse(fs.readFileSync(objdir + "all-tests.json", "utf-8"));
let manifests = {};
for (let name in allTests) {
let test = allTests[name];
for (let entry of test) {
if (entry.flavor == flavor) {
handleTest(entry);
}
}
}
showResults();
displayStats();
// ================== //
function handleTest(test) {
if (test.subsuite == "devtools") {
return;
}
let manifestName = path.relative(srcdir, test.manifest);
if (manifestName == "dom/browser-element/mochitest/mochitest-oop.ini" ||
manifestName == "dom/canvas/test/_webgl-conformance.ini" ||
manifestName == "dom/browser-element/mochitest/mochitest.ini") {
return;
}
let manifest;
if (!manifests[manifestName]) {
manifest = manifests[manifestName] = {
disabled: [],
enabled: []
};
} else {
manifest = manifests[manifestName];
}
let skipIf = test["skip-if"] || "";
let disabledForE10s = skipIf.includes("e10s") &&
!skipIf.includes("!e10s");
manifest[disabledForE10s ? "disabled" : "enabled"].push(test);
}
function spc(count) {
if (count < 1) count = 1;
let ret = "";
while (count--) {
ret += " ";
}
return ret;
}
function showResults() {
for (let manifestName in manifests) {
let manifest = manifests[manifestName];
if (manifest.disabled.length == 0) {
continue;
}
console.log(manifestName + ":");
let largestName = 0;
for (let test of manifest.disabled) {
let testLength = test.name.length;
if (test.tags) {
testLength += test.tags.length + 3;
}
largestName = Math.max(largestName, testLength);
}
for (let test of manifest.disabled) {
let name = test.name;
if (test.tags) {
name += " (" + test.tags + ")";
}
console.log(" " + name + spc(largestName + 4 - name.length) + "skip-if = " + test["skip-if"].substr(0,100) + (test["skip-if"].length > 100 ? "..." : ""));
}
console.log("");
}
}
function displayStats() {
let enabled = 0, disabled = 0;
for (let manifestName in manifests) {
let manifest = manifests[manifestName];
enabled += manifest.enabled.length;
disabled += manifest.disabled.length;
}
let total = enabled + disabled;
function pct(a, b) {
return (Math.round((a/b) * 10000) / 100);
}
console.log("Total tests: " + total);
console.log("Enabled tests: " + enabled + " (" + pct(enabled, total) + "%)");
console.log("Disabled tests: " + disabled + " (" + pct(disabled, total) + "%)");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment