Bug 1369471 - Allow running wpt directories by path on the command line, r=maja_zf
authorJames Graham <james@hoppipolla.co.uk>
Thu, 01 Jun 2017 19:01:01 +0100
changeset 412549 5baa39559276cd83a14d020e7c06b84574e99bce
parent 412548 39bbafe0ef81b6d16438bc7de2549ae595adaf86
child 412550 627055e30ca40ca5f4f7174dbcd2fb76a4ba73a9
push id1490
push usermtabara@mozilla.com
push dateMon, 31 Jul 2017 14:08:16 +0000
treeherdermozilla-release@70e32e6bf15e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmaja_zf
bugs1369471
milestone55.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 1369471 - Allow running wpt directories by path on the command line, r=maja_zf We regressed running entire directories when wptrunner was switched to look up command parameters directly in the manifest rather than iterating over prefix matches. For files that's OK, but for directories the old behaviour is required. MozReview-Commit-ID: HVL7rL1YuZx
testing/web-platform/tests/tools/manifest/manifest.py
testing/web-platform/tests/tools/wptrunner/wptrunner/manifestinclude.py
--- a/testing/web-platform/tests/tools/manifest/manifest.py
+++ b/testing/web-platform/tests/tools/manifest/manifest.py
@@ -46,16 +46,25 @@ class Manifest(object):
             for path, tests in sorted(iteritems(self._data[item_type])):
                 yield item_type, path, tests
 
     def iterpath(self, path):
         for type_tests in self._data.values():
             for test in type_tests.get(path, set()):
                 yield test
 
+    def iterdir(self, dir_name):
+        if not dir_name.endswith(os.path.sep):
+            dir_name = dir_name + os.path.sep
+        for type_tests in self._data.values():
+            for path, tests in type_tests.iteritems():
+                if path.startswith(dir_name):
+                    for test in tests:
+                        yield test
+
     @property
     def reftest_nodes_by_url(self):
         if self._reftest_nodes_by_url is None:
             by_url = {}
             for path, nodes in iteritems(self._data.get("reftests", {})):
                 for node in nodes:
                     by_url[node.url] = node
             self._reftest_nodes_by_url = by_url
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/manifestinclude.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/manifestinclude.py
@@ -88,17 +88,18 @@ class IncludeManifest(ManifestItem):
         paths = glob.glob(maybe_path)
 
         if paths:
             urls = []
             for path in paths:
                 for manifest, data in test_manifests.iteritems():
                     found = False
                     rel_path = os.path.relpath(path, data["tests_path"])
-                    for test in manifest.iterpath(rel_path):
+                    iterator = manifest.iterpath if os.path.isfile(path) else manifest.iterdir
+                    for test in iterator(rel_path):
                         if not hasattr(test, "url"):
                             continue
                         url = test.url
                         if query or fragment:
                             parsed = urlparse.urlparse(url)
                             if ((query and query != parsed.query) or
                                 (fragment and fragment != parsed.fragment)):
                                 continue