Bug 1401207 - Implement ./mach talos --subtests to allow filtering DAMP tests. r=jmaher

MozReview-Commit-ID: BAaVYjOofJE

--HG--
extra : rebase_source : 4ed15e50ceb1f2dddbdf89bc711712f3e80b3f0e
This commit is contained in:
Alexandre Poirot 2017-10-17 09:00:00 -07:00
Родитель 39b0a55bf6
Коммит 5995a00478
4 изменённых файлов: 26 добавлений и 0 удалений

Просмотреть файл

@ -68,6 +68,8 @@ def create_parser(mach_interface=False):
help="List of tests to run, separated by ':' (ex. damp:cart)")
add_arg('--suite',
help="Suite to use (instead of --activeTests)")
add_arg('--subtests',
help="Name of the subtest(s) to run (works only on DAMP)")
add_arg('--disable-e10s', dest='e10s',
action='store_false', default=True,
help="disable e10s")

Просмотреть файл

@ -451,6 +451,7 @@ def get_browser_config(config):
'enable_stylo': False,
'disable_stylo': False,
'stylothreads': 0,
'subtests': None,
}
browser_config = dict(title=config['title'])
browser_config.update(dict([(i, config[i]) for i in required]))

Просмотреть файл

@ -125,6 +125,10 @@ def run_tests(config, browser_config):
LOG.info("Using firstNonBlankPaint, so turning on pref for it")
browser_config['preferences']['dom.performance.time_to_non_blank_paint.enabled'] = True
# Pass subtests filter argument via a preference
if browser_config['subtests']:
browser_config['preferences']['talos.subtests'] = browser_config['subtests']
# set defaults
testdate = config.get('testdate', '')

Просмотреть файл

@ -675,6 +675,25 @@ Damp.prototype = {
tests["console.streamlog"] = this._consoleStreamLoggingTest;
tests["console.objectexpand"] = this._consoleObjectExpansionTest;
// Filter tests via `./mach --subtests filter` command line argument
let filter;
try {
filter = Services.prefs.getCharPref("talos.subtests");
} catch(e) {}
if (filter) {
for(let name in tests) {
if (!name.includes(filter)) {
delete tests[name];
}
}
if (Object.keys(tests).length == 0) {
dump("ERROR: Unable to find any test matching '" + filter + "'\n");
this._doneInternal();
return;
}
}
// Construct the sequence array while filtering tests
let sequenceArray = [];
for (var i in config.subtests) {