Bug 1445677 - Fix 'mach test-info' platform handling; r=jmaher
authorGeoff Brown <gbrown@mozilla.com>
Thu, 25 Apr 2019 09:20:06 +0000
changeset 471302 2705cdbf8f776ec6aab7e86de7ae9ea25eec728f
parent 471301 82a99a3ad6682ed02122d4444795010a691c55e8
child 471303 18ba664cbccf7d403428312fd6ca48cd8095132f
push id35915
push useropoprus@mozilla.com
push dateThu, 25 Apr 2019 22:08:17 +0000
treeherdermozilla-central@7e40e33da3da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs1445677
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1445677 - Fix 'mach test-info' platform handling; r=jmaher The format of platform and type data seems to have evolved over time; these changes seem to handle the new formats well. Differential Revision: https://phabricator.services.mozilla.com/D28766
testing/mach_commands.py
--- a/testing/mach_commands.py
+++ b/testing/mach_commands.py
@@ -850,23 +850,28 @@ class TestInfoCommand(MachCommandBase):
             print("Found records matching '%s' in ActiveData." %
                   self.activedata_test_name)
         else:
             print("Unable to find matching records in ActiveData; using %s!" %
                   self.test_name)
             self.activedata_test_name = self.test_name
 
     def get_platform(self, record):
-        platform = record['build']['platform']
-        type = record['build']['type']
-        if 'run' in record and 'type' in record['run'] and 'e10s' in record['run']['type']:
+        if 'platform' in record['build']:
+            platform = record['build']['platform']
+        else:
+            platform = "-"
+        tp = record['build']['type']
+        if type(tp) is list:
+            tp = "-".join(tp)
+        if 'run' in record and 'type' in record['run'] and 'e10s' in str(record['run']['type']):
             e10s = "-e10s"
         else:
             e10s = ""
-        return "%s/%s%s:" % (platform, type, e10s)
+        return "%s/%s%s:" % (platform, tp, e10s)
 
     def submit(self, query):
         import requests
         import datetime
         if self.verbose:
             print(datetime.datetime.now())
             print(json.dumps(query))
         response = requests.post("http://activedata.allizom.org/query",
@@ -910,16 +915,18 @@ class TestInfoCommand(MachCommandBase):
         if data and len(data) > 0:
             data.sort(key=self.get_platform)
             worst_rate = 0.0
             worst_platform = None
             total_runs = 0
             total_failures = 0
             for record in data:
                 platform = self.get_platform(record)
+                if platform.startswith("-"):
+                    continue
                 runs = record['count']
                 total_runs = total_runs + runs
                 failures = record.get('failures', 0)
                 total_failures = total_failures + failures
                 rate = (float)(failures) / runs
                 if rate >= worst_rate:
                     worst_rate = rate
                     worst_platform = platform
@@ -959,16 +966,18 @@ class TestInfoCommand(MachCommandBase):
         }
         data = self.submit(query)
         print("\nTest durations for %s on %s between %s and %s" %
               (self.activedata_test_name, self.branches, self.start, self.end))
         if data and len(data) > 0:
             data.sort(key=self.get_platform)
             for record in data:
                 platform = self.get_platform(record)
+                if platform.startswith("-"):
+                    continue
                 print("%-40s %6.2f s (%.2f s - %.2f s over %d runs)" % (
                     platform, record['average'], record['min'],
                     record['max'], record['count']))
         else:
             print("No test durations found.")
 
     def report_test_tasks(self):
         # Report test tasks summary from ActiveData