Bug 1337828 - Improve mochitest 'no tests' error message, r=maja_zf
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Thu, 09 Feb 2017 09:55:23 -0500
changeset 342754 b83537047757127f89aa5d6f397ab92460c0fad3
parent 342753 e725ba1475be5300919d3be04b7dedafa3e02f43
child 342755 3dbcf029aa26b693e4e0cfa5454ae1a8c66dab25
push id31362
push userkwierso@gmail.com
push dateTue, 14 Feb 2017 20:55:38 +0000
treeherdermozilla-central@c5a25b056d1e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmaja_zf
bugs1337828
milestone54.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 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: