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
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -2078,17 +2078,17 @@ toolbar#nav-bar {
options.profilePath = None
self.urlOpts = []
def resolve_runtime_file(self, options):
"""
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
slug = self.normflavor(options.flavor)
if slug == 'browser-chrome' and options.subsuite == 'devtools':
slug = 'devtools-chrome'
elif slug == 'mochitest':
slug = 'plain'
--- a/testing/runtimes/writeruntimes.py
+++ b/testing/runtimes/writeruntimes.py
@@ -6,31 +6,36 @@ import sys
import requests
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",
"limit":200000,
"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,
stream=True)
response.raise_for_status()
data = response.json()["data"]
return data
@@ -100,23 +105,30 @@ def cli(args=sys.argv[1:]):
default=here, help="Directory from which to read current runtime data.")
parser.add_argument('-p', '--platforms', default=None,
help="Comma separated list of platforms from which to generate data.")
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:
raise ValueError("Must specify suite with the -s argument")
if ',' in args.suite:
raise ValueError("Passing multiple suites is not supported")
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())