Bug 1577483 [wpt PR 18746] - Remove support for stub-* files in the manifest, a=testonly
authorPhilip Jägenstedt <philip@foolip.org>
Fri, 13 Sep 2019 10:33:10 +0000
changeset 493136 b3fe57c7e58b3677067506469589a45dd3f7e28e
parent 493135 7b7c83025c126f335ad11bf835d61ec9db2b49ce
child 493137 c6e998577723c6cd273b8126e1a3a8ec3e340573
push id114083
push userwptsync@mozilla.com
push dateSat, 14 Sep 2019 15:07:18 +0000
treeherdermozilla-inbound@4d3effdba55e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1577483, 18746, 18745
milestone71.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 1577483 [wpt PR 18746] - Remove support for stub-* files in the manifest, a=testonly Automatic update from web-platform-tests Remove support for stub-* files in the manifest (#18746) The manifest support was added in commit 2650e630d310d720b5eb8f94b39960689cec8160, ensuring they aren't treated as tests. All sub-* files were removed in https://github.com/web-platform-tests/wpt/pull/18745. We still tolerate and drop "stub" items when loading an older manifest version until we bump the version to 7. Part 2 of https://github.com/web-platform-tests/rfcs/pull/27. -- wpt-commits: 7e484c2125ef52bd306cba773ca43397a4d8e9e7 wpt-pr: 18746
testing/web-platform/tests/tools/manifest/item.py
testing/web-platform/tests/tools/manifest/manifest.py
testing/web-platform/tests/tools/manifest/sourcefile.py
testing/web-platform/tests/tools/manifest/tests/test_manifest.py
testing/web-platform/tests/tools/wptrunner/wptrunner/metadata.py
testing/web-platform/tests/tools/wptrunner/wptrunner/tests/test_update.py
--- a/testing/web-platform/tests/tools/manifest/item.py
+++ b/testing/web-platform/tests/tools/manifest/item.py
@@ -324,22 +324,16 @@ class ConformanceCheckerTest(URLManifest
 
 
 class VisualTest(URLManifestItem):
     __slots__ = ()
 
     item_type = "visual"
 
 
-class Stub(URLManifestItem):
-    __slots__ = ()
-
-    item_type = "stub"
-
-
 class WebDriverSpecTest(URLManifestItem):
     __slots__ = ()
 
     item_type = "wdspec"
 
     @property
     def timeout(self):
         # type: () -> Optional[Text]
--- a/testing/web-platform/tests/tools/manifest/manifest.py
+++ b/testing/web-platform/tests/tools/manifest/manifest.py
@@ -1,16 +1,16 @@
 import itertools
 import json
 import os
 from collections import MutableMapping, defaultdict
 from six import iteritems, iterkeys, itervalues, string_types, binary_type, text_type
 
 from . import vcs
-from .item import (ConformanceCheckerTest, ManifestItem, ManualTest, RefTest, RefTestNode, Stub,
+from .item import (ConformanceCheckerTest, ManifestItem, ManualTest, RefTest, RefTestNode,
                    SupportFile, TestharnessTest, VisualTest, WebDriverSpecTest)
 from .log import get_logger
 from .sourcefile import SourceFile
 from .utils import from_os_path, to_os_path
 
 MYPY = False
 if MYPY:
     # MYPY is set to True when run under Mypy.
@@ -46,17 +46,16 @@ class ManifestError(Exception):
 class ManifestVersionMismatch(ManifestError):
     pass
 
 
 item_classes = {"testharness": TestharnessTest,
                 "reftest": RefTest,
                 "reftest_node": RefTestNode,
                 "manual": ManualTest,
-                "stub": Stub,
                 "wdspec": WebDriverSpecTest,
                 "conformancechecker": ConformanceCheckerTest,
                 "visual": VisualTest,
                 "support": SupportFile}  # type: Dict[str, Type[ManifestItem]]
 
 
 if MYPY:
     TypeDataType = MutableMapping[Text, Set[ManifestItem]]
@@ -466,16 +465,24 @@ class Manifest(object):
 
         self = cls(tests_root, url_base=obj.get("url_base", "/"))
         if not hasattr(obj, "items") and hasattr(obj, "paths"):
             raise ManifestError
 
         self._path_hash = {to_os_path(k): v for k, v in iteritems(obj["paths"])}
 
         for test_type, type_paths in iteritems(obj["items"]):
+            # Drop "stub" items, which are no longer supported but may be
+            # present when doing an incremental manifest update.
+            # See https://github.com/web-platform-tests/rfcs/pull/27 for background.
+            #
+            # TODO(MANIFESTv7): remove this condition
+            if test_type == "stub":
+                continue
+
             if test_type not in item_classes:
                 raise ManifestError
 
             if types and test_type not in types:
                 continue
 
             self._data[test_type].set_json(tests_root, type_paths)
 
--- a/testing/web-platform/tests/tools/manifest/sourcefile.py
+++ b/testing/web-platform/tests/tools/manifest/sourcefile.py
@@ -28,17 +28,17 @@ if MYPY:
 try:
     from xml.etree import cElementTree as ElementTree
 except ImportError:
     from xml.etree import ElementTree as ElementTree  # type: ignore
 
 import html5lib
 
 from . import XMLParser
-from .item import (ManifestItem, Stub, ManualTest, WebDriverSpecTest, RefTestNode, TestharnessTest,
+from .item import (ManifestItem, ManualTest, WebDriverSpecTest, RefTestNode, TestharnessTest,
                    SupportFile, ConformanceCheckerTest, VisualTest)
 from .utils import ContextManagerBytesIO, cached_property
 
 wd_pattern = "*.py"
 js_meta_re = re.compile(br"//\s*META:\s*(\w*)=(.*)$")
 python_meta_re = re.compile(br"#\s*META:\s*(\w*)=(.*)$")
 
 reference_file_re = re.compile(r'(^|[\-_])(not)?ref[0-9]*([\-_]|$)')
@@ -348,23 +348,16 @@ class SourceFile(object):
                 self.type_flag in ("is-valid", "no-valid"))
 
     @property
     def name_is_conformance_support(self):
         # type: () -> bool
         return self.in_conformance_checker_dir()
 
     @property
-    def name_is_stub(self):
-        # type: () -> bool
-        """Check if the file name matches the conditions for the file to
-        be a stub file"""
-        return self.name_prefix("stub-")
-
-    @property
     def name_is_manual(self):
         # type: () -> bool
         """Check if the file name matches the conditions for the file to
         be a manual test file"""
         return self.type_flag == "manual"
 
     @property
     def name_is_visual(self):
@@ -788,25 +781,16 @@ class SourceFile(object):
 
         if self.name_is_non_test:
             rv = "support", [
                 SupportFile(
                     self.tests_root,
                     self.rel_path
                 )]  # type: Tuple[Text, List[ManifestItem]]
 
-        elif self.name_is_stub:
-            rv = Stub.item_type, [
-                Stub(
-                    self.tests_root,
-                    self.rel_path,
-                    self.url_base,
-                    self.rel_url
-                )]
-
         elif self.name_is_manual:
             rv = ManualTest.item_type, [
                 ManualTest(
                     self.tests_root,
                     self.rel_path,
                     self.url_base,
                     self.rel_url
                 )]
--- a/testing/web-platform/tests/tools/manifest/tests/test_manifest.py
+++ b/testing/web-platform/tests/tools/manifest/tests/test_manifest.py
@@ -45,17 +45,17 @@ def rel_dir_file_path(draw):
         alphabet = "a" + os.path.sep
         mid = draw(hs.text(alphabet=alphabet, min_size=remaining, max_size=remaining))
         return os.path.normcase("a" + mid + "a")
 
 
 @hs.composite
 def sourcefile_strategy(draw):
     item_classes = [item.TestharnessTest, item.RefTestNode,
-                    item.ManualTest, item.Stub, item.WebDriverSpecTest,
+                    item.ManualTest, item.WebDriverSpecTest,
                     item.ConformanceCheckerTest, item.SupportFile]
     cls = draw(hs.sampled_from(item_classes))
 
     path = draw(rel_dir_file_path())
     hash = draw(hs.text(alphabet="0123456789abcdef", min_size=40, max_size=40))
     s = mock.Mock(rel_path=path, hash=hash)
 
     if cls is item.RefTestNode:
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/metadata.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/metadata.py
@@ -495,17 +495,17 @@ class ExpectedUpdater(object):
                 test_data.set_requires_update()
 
 
 def create_test_tree(metadata_path, test_manifest):
     """Create a map of test_id to TestFileData for that test.
     """
     do_delayed_imports()
     id_test_map = {}
-    exclude_types = frozenset(["stub", "manual", "support", "conformancechecker"])
+    exclude_types = frozenset(["manual", "support", "conformancechecker"])
     all_types = set(manifestitem.item_types.keys())
     assert all_types > exclude_types
     include_types = all_types - exclude_types
     for item_type, test_path, tests in test_manifest.itertypes(*include_types):
         test_file_data = TestFileData(intern(test_manifest.url_base.encode("utf8")),
                                       intern(item_type.encode("utf8")),
                                       metadata_path,
                                       test_path,
--- a/testing/web-platform/tests/tools/wptrunner/wptrunner/tests/test_update.py
+++ b/testing/web-platform/tests/tools/wptrunner/wptrunner/tests/test_update.py
@@ -26,17 +26,16 @@ def SourceFileWithTest(path, hash, cls, 
     s.manifest_items = mock.Mock(return_value=(cls.item_type, [test]))
     return s
 
 
 item_classes = {"testharness": manifest_item.TestharnessTest,
                 "reftest": manifest_item.RefTest,
                 "reftest_node": manifest_item.RefTestNode,
                 "manual": manifest_item.ManualTest,
-                "stub": manifest_item.Stub,
                 "wdspec": manifest_item.WebDriverSpecTest,
                 "conformancechecker": manifest_item.ConformanceCheckerTest,
                 "visual": manifest_item.VisualTest,
                 "support": manifest_item.SupportFile}
 
 
 default_run_info = {"debug": False, "os": "linux", "version": "18.04", "processor": "x86_64", "bits": 64}
 test_id = "/path/to/test.htm"