Bug 1324047 - Update testing/runtimes/writeruntimes.py for new e10s schema in ActiveData, r=jgriffin

At some point ActiveData stopped considering 'e10s' as a separate suite and instead stored this information
in the "run.type" field. This updates the writeruntimes.py script and mochitest runtime file resolving accordingly.

MozReview-Commit-ID: LSk2q0hafcm

--HG--
extra : rebase_source : 935942fb02f72d790464a30734ab153c2d56d5a9
This commit is contained in:
Andrew Halberstadt 2016-12-19 12:09:10 -05:00
Родитель f27d72c33d
Коммит 2ef7e2e6e8
2 изменённых файлов: 18 добавлений и 6 удалений

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

@ -2083,7 +2083,7 @@ toolbar#nav-bar {
Return a path to the runtimes file for a given flavor and
subsuite.
"""
template = "mochitest{e10s}-{suite_slug}.runtimes.json"
template = "mochitest-{suite_slug}{e10s}.runtimes.json"
data_dir = os.path.join(SCRIPT_DIR, 'runtimes')
# Determine the suite slug in the runtimes file name

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

@ -11,9 +11,13 @@ here = os.path.abspath(os.path.dirname(__file__))
ACTIVE_DATA_URL = "http://activedata.allizom.org/query"
PERCENTILE = 0.5 # ignore the bottom PERCENTILE*100% of numbers
def query_activedata(suite, platforms=None):
def query_activedata(suite, e10s, platforms=None):
platforms = ', "build.platform":%s' % json.dumps(platforms) if platforms else ''
e10s_clause = '"eq":{"run.type":"e10s"}'
if not e10s:
e10s_clause = '"not":{%s}' % e10s_clause
query = """
{
"from":"unittest",
@ -21,11 +25,12 @@ def query_activedata(suite, platforms=None):
"groupby":["result.test"],
"select":{"value":"result.duration","aggregate":"average"},
"where":{"and":[
{"eq":{"suite":"%s"%s}},
{"eq":{"run.suite":"%s"%s}},
{%s},
{"gt":{"run.timestamp":"{{today-week}}"}}
]}
}
""" % (suite, platforms)
""" % (suite, platforms, e10s_clause)
response = requests.post(ACTIVE_DATA_URL,
data=query,
@ -105,6 +110,9 @@ def cli(args=sys.argv[1:]):
parser.add_argument('-s', '--suite', dest='suite', default=None,
help="Suite for which to generate data.")
parser.add_argument('--disable-e10s', dest='e10s', default=True,
action='store_false', help="Generate runtimes for non-e10s tests.")
args = parser.parse_args(args)
if not args.suite:
@ -115,8 +123,12 @@ def cli(args=sys.argv[1:]):
if args.platforms:
args.platforms = args.platforms.split(',')
data = query_activedata(args.suite, args.platforms)
write_runtimes(data, args.suite, indir=args.indir, outdir=args.outdir)
data = query_activedata(args.suite, args.e10s, args.platforms)
suite = args.suite
if args.e10s:
suite = '%s-e10s' % suite
write_runtimes(data, suite, indir=args.indir, outdir=args.outdir)
if __name__ == "__main__":
sys.exit(cli())