Bug 1296735 - [manifestparser] pathprefix filter should use absolute paths if the filter is also absolute, r?jmaher draft
authorAndrew Halberstadt <ahalberstadt@mozilla.com>
Mon, 22 Aug 2016 13:31:56 -0400
changeset 404057 8738a60d886eb3e588ebe757489d94479cf9626f
parent 403970 194fe275b4e60ded2af6b25173eec421f0dba8ad
child 529077 bcc0470434c8974546b74ff2a5e1dbd1be63e267
push id27092
push userahalberstadt@mozilla.com
push dateMon, 22 Aug 2016 18:55:38 +0000
reviewersjmaher
bugs1296735
milestone51.0a1
Bug 1296735 - [manifestparser] pathprefix filter should use absolute paths if the filter is also absolute, r?jmaher This fixes an error when attempting to run xpcshell-test with a test path from an interactive loaner. MozReview-Commit-ID: 20kg5zKplhT
testing/mozbase/manifestparser/manifestparser/filters.py
--- a/testing/mozbase/manifestparser/manifestparser/filters.py
+++ b/testing/mozbase/manifestparser/manifestparser/filters.py
@@ -351,17 +351,22 @@ class pathprefix(InstanceFilter):
         if isinstance(paths, basestring):
             paths = [paths]
         self.paths = paths
 
     def __call__(self, tests, values):
         for test in tests:
             for tp in self.paths:
                 tp = os.path.normpath(tp)
-                if not os.path.normpath(test['relpath']).startswith(tp):
+
+                path = test['relpath']
+                if os.path.isabs(tp):
+                    path = test['path']
+
+                if not os.path.normpath(path).startswith(tp):
                     continue
 
                 # any test path that points to a single file will be run no
                 # matter what, even if it's disabled
                 if 'disabled' in test and os.path.normpath(test['relpath']) == tp:
                     del test['disabled']
                 yield test
                 break