Bug 1408385 - Make sure python-test tasks turn orange if no tests are run, r=davehunt
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Fri, 13 Oct 2017 09:42:06 -0400
changeset 386096 f930a2432a7cf46f91b2488ef414bec8803473b2
parent 386095 dade3202fe0d663561d95011dd74cfd592aa4068
child 386097 e29f8c4283ac6bf06f23b2338f3ac6ac3bf4d9f5
push id32675
push userarchaeopteryx@coole-files.de
push dateFri, 13 Oct 2017 21:36:21 +0000
treeherdermozilla-central@684b9ee0468e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdavehunt
bugs1408385
milestone58.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 1408385 - Make sure python-test tasks turn orange if no tests are run, r=davehunt MozReview-Commit-ID: 8HAGvOg1Bbp
python/mach_commands.py
--- a/python/mach_commands.py
+++ b/python/mach_commands.py
@@ -120,29 +120,31 @@ class MachCommands(MachCommandBase):
                                                       flavor='python')
             else:
                 # Otherwise just run everything in PYTHON_UNITTEST_MANIFESTS
                 test_objects = resolver.resolve_tests(flavor='python')
 
         mp = TestManifest()
         mp.tests.extend(test_objects)
 
-        if not mp.tests:
-            message = 'TEST-UNEXPECTED-FAIL | No tests collected ' + \
-                      '(Not in PYTHON_UNITTEST_MANIFESTS?)'
-            self.log(logging.WARN, 'python-test', {}, message)
-            return 1
-
         filters = []
         if subsuite == 'default':
             filters.append(mpf.subsuite(None))
         elif subsuite:
             filters.append(mpf.subsuite(subsuite))
 
         tests = mp.active_tests(filters=filters, disabled=False, **mozinfo.info)
+
+        if not tests:
+            submsg = "for subsuite '{}' ".format(subsuite) if subsuite else ""
+            message = "TEST-UNEXPECTED-FAIL | No tests collected " + \
+                      "{}(Not in PYTHON_UNITTEST_MANIFESTS?)".format(submsg)
+            self.log(logging.WARN, 'python-test', {}, message)
+            return 1
+
         parallel = []
         sequential = []
         for test in tests:
             if test.get('sequential'):
                 sequential.append(test)
             else:
                 parallel.append(test)