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
--- 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: