Bug 1365621 - Display manifest info in |mach test-info|; r=jmaher
authorGeoff Brown <gbrown@mozilla.com>
Wed, 17 May 2017 10:30:36 -0600
changeset 406962 347c5cc8e367e0519d45a0da97ce98608128fd38
parent 406961 af8c7cffc22a382b0914bcda418f69ee62af1b32
child 406963 fb4daf2e29dc6286dd815932871733f0a4d61e6a
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs1365621
milestone55.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 1365621 - Display manifest info in |mach test-info|; r=jmaher
testing/mach_commands.py
--- a/testing/mach_commands.py
+++ b/testing/mach_commands.py
@@ -987,16 +987,35 @@ class TestInfoCommand(MachCommandBase):
                 for line in out:
                     print(line)
         if self.full_test_name:
             print("Found %s in source control." % self.full_test_name)
         else:
             print("Unable to validate test name '%s'!" % self.test_name)
             self.full_test_name = self.test_name
 
+        # search for full_test_name in test manifests
+        from mozbuild.testing import TestResolver
+        resolver = self._spawn(TestResolver)
+        relpath = self._wrap_path_argument(self.full_test_name).relpath()
+        tests = list(resolver.resolve_tests(paths=[relpath]))
+        if len(tests) == 1:
+            relpath = self._wrap_path_argument(tests[0]['manifest']).relpath()
+            print("%s found in manifest %s" % (self.full_test_name, relpath))
+            if tests[0].get('flavor'):
+                print("  flavor: %s" % tests[0]['flavor'])
+            if tests[0].get('skip-if'):
+                print("  skip-if: %s" % tests[0]['skip-if'])
+            if tests[0].get('fail-if'):
+                print("  fail-if: %s" % tests[0]['fail-if'])
+        elif len(tests) == 0:
+            print("%s not found in any test manifest!" % self.full_test_name)
+        else:
+            print("%s found in more than one manifest!" % self.full_test_name)
+
         # short_name is full_test_name without path
         self.short_name = None
         name_idx = self.full_test_name.rfind('/')
         if name_idx > 0:
             self.short_name = self.full_test_name[name_idx+1:]
 
         # robo_name is short_name without ".java" - for robocop
         self.robo_name = None