Bug 1337828 - Pass unexpected test paths as is from mach_test_package_bootstrap to the test harness, r=maja_zf
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Thu, 09 Feb 2017 09:55:18 -0500
changeset 342751 e725ba1475be5300919d3be04b7dedafa3e02f43
parent 342750 5d74575ffa14f6de0ca8a1b7dc77e9e4398c9e49
child 342752 b83537047757127f89aa5d6f397ab92460c0fad3
push id37362
push userahalberstadt@mozilla.com
push dateTue, 14 Feb 2017 16:57:02 +0000
treeherderautoland@b83537047757 [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 - 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.