Bug 1337828 - Improve mochitest 'no tests' error message, r?maja_zf draft
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Thu, 09 Feb 2017 09:55:23 -0500
changeset 483555 cca57b563625e1a84f47a5163861f28b05102ea2
parent 483554 7ede16b1bb1e0298d3006bfb6368245abea40b72
child 545664 23e95cc8ca41840d020b14e1e8d72d7cb9db5cfa
push id45340
push userahalberstadt@mozilla.com
push dateTue, 14 Feb 2017 14:30:58 +0000
reviewersmaja_zf
bugs1337828
milestone54.0a1
Bug 1337828 - Improve mochitest 'no tests' error message, r?maja_zf Include the current flavor in the "No tests found" error message. Also suggest what may have went wrong. MozReview-Commit-ID: 5LEQFVDoJrT
testing/mochitest/runtests.py
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -75,16 +75,25 @@ HAVE_PSUTIL = False
 try:
     import psutil
     HAVE_PSUTIL = True
 except ImportError:
     pass
 
 here = os.path.abspath(os.path.dirname(__file__))
 
+NO_TESTS_FOUND = """
+No tests were found for flavor '{}' and the following manifest filters:
+{}
+
+Make sure the test paths (if any) are spelt correctly and the corresponding
+--flavor and --subsuite are being used. See `mach mochitest --help` for a
+list of valid flavors.
+""".lstrip()
+
 
 ########################################
 # Option for MOZ (former NSPR) logging #
 ########################################
 
 # Set the desired log modules you want a log be produced
 # by a try run for, or leave blank to disable the feature.
 # This will be passed to MOZ_LOG environment variable.
@@ -1367,19 +1376,17 @@ toolbar#nav-bar {
                 else:
                     filters.append(chunk_by_slice(options.thisChunk,
                                                   options.totalChunks))
 
             tests = manifest.active_tests(
                 exists=False, disabled=disabled, filters=filters, **info)
 
             if len(tests) == 0:
-                self.log.error("no tests to run using specified "
-                               "combination of filters: {}".format(
-                                   manifest.fmt_filters()))
+                self.log.error(NO_TESTS_FOUND.format(options.flavor, manifest.fmt_filters()))
 
         paths = []
 
         # When running mochitest locally the manifest is based on topsrcdir,
         # but when running in automation it is based on the test root.
         manifest_root = build_obj.topsrcdir if build_obj else self.testRootAbs
         manifests = set()
         for test in tests: