Bug 1324047 - Update testing/runtimes/writeruntimes.py for new e10s schema in ActiveData. r=jgriffin, a=test-only
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Mon, 19 Dec 2016 12:09:10 -0500
changeset 353233 70f7c3097f86ce89cfc61b7eac1ae848ae0cf2dc
parent 353232 028c461415da121f3e04e0249d3d6619222ec93c
child 353234 cbcb03d56b923a93d2ff69873b6ff0b6678cf874
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-esr52@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgriffin, test-only
bugs1324047
milestone52.0a2
Bug 1324047 - Update testing/runtimes/writeruntimes.py for new e10s schema in ActiveData. r=jgriffin, a=test-only 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
testing/mochitest/runtests.py
testing/runtimes/writeruntimes.py
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -2088,17 +2088,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())