Bug 1408385 - Make sure python-test tasks turn orange if no tests are run, r?davehunt draft
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Fri, 13 Oct 2017 09:42:06 -0400
changeset 680055 b120aa1ce1aab603b960adbae520644485120a82
parent 680024 196dadb2fe500e75c6fbddcac78106648676cf10
child 735753 9066618a34ad525692d64e090875f10e50f7bdb7
push id84387
push userahalberstadt@mozilla.com
push dateFri, 13 Oct 2017 13:49:12 +0000
reviewersdavehunt
bugs1408385
milestone58.0a1
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)