Bug 1233506 - Only accept positional arguments to mach try that are directories. r=jgraham
authorChris Manchester <cmanchester@mozilla.com>
Thu, 17 Dec 2015 12:38:32 -0800
changeset 277051 cfa47883e49238453e30fb6ac305b4cd1da752a6
parent 277050 6630a176477ef903dcf3057db755abc43ba5018d
child 277052 cf947522f851039a66ec1c59bf61f2589972c5c0
push id16724
push usercbook@mozilla.com
push dateMon, 21 Dec 2015 11:00:52 +0000
treeherderfx-team@3f3f0361567c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjgraham
bugs1233506
milestone46.0a1
Bug 1233506 - Only accept positional arguments to mach try that are directories. r=jgraham
testing/mach_commands.py
--- a/testing/mach_commands.py
+++ b/testing/mach_commands.py
@@ -528,19 +528,19 @@ class PushToTry(MachCommandBase):
                      if kwargs["talos"] else [])
         except ValueError as e:
             print("Error parsing -t argument:\n%s" % e.message)
             sys.exit(1)
 
         paths = []
         for p in kwargs["paths"]:
             p = os.path.normpath(os.path.abspath(p))
-            if not p.startswith(self.topsrcdir):
-                print('Specified path "%s" is outside of the srcdir, unable to'
-                      ' specify tests outside of the srcdir' % p)
+            if not (os.path.isdir(p) and p.startswith(self.topsrcdir)):
+                print('Specified path "%s" is not a directory under the srcdir,'
+                      ' unable to specify tests outside of the srcdir' % p)
                 sys.exit(1)
             if len(p) <= len(self.topsrcdir):
                 print('Specified path "%s" is at the top of the srcdir and would'
                       ' select all tests.' % p)
                 sys.exit(1)
             paths.append(os.path.relpath(p, self.topsrcdir))
 
         try: