Bug 1337828 - Pass unexpected test paths as is from mach_test_package_bootstrap to the test harness, r?maja_zf
This was a bug in the mach test package bootstrap that could happen in one-click loaners. If a user neglected to
pass in --flavor, this meant that instead of a nice error message out of mochitest, they'd get a cryptic
traceback.
With this fix, it will be obvious that the problem is "no tests were found".
MozReview-Commit-ID: 5LEQFVDoJrT
--- a/testing/tools/mach_test_package_bootstrap.py
+++ b/testing/tools/mach_test_package_bootstrap.py
@@ -153,16 +153,18 @@ def find_hostutils(context):
def normalize_test_path(test_root, path):
if os.path.isabs(path) or os.path.exists(path):
return os.path.normpath(os.path.abspath(path))
for parent in ancestors(test_root):
test_path = os.path.join(parent, path)
if os.path.exists(test_path):
return os.path.normpath(os.path.abspath(test_path))
+ # Not a valid path? Return as is and let test harness deal with it
+ return path
def bootstrap(test_package_root):
test_package_root = os.path.abspath(test_package_root)
# Ensure we are running Python 2.7+. We put this check here so we generate a
# user-friendly error message rather than a cryptic stack trace on module
# import.