Bug 1337828 - Pass unexpected test paths as is from mach_test_package_bootstrap to the test harness, r?maja_zf draft
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Thu, 09 Feb 2017 09:55:18 -0500
changeset 483554 7ede16b1bb1e0298d3006bfb6368245abea40b72
parent 482778 3c300355a94d24e0c1c156f9de4a6e9c60beaa28
child 483555 cca57b563625e1a84f47a5163861f28b05102ea2
push id45340
push userahalberstadt@mozilla.com
push dateTue, 14 Feb 2017 14:30:58 +0000
reviewersmaja_zf
bugs1337828
milestone54.0a1
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
testing/tools/mach_test_package_bootstrap.py
--- 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.