Skip to content

Commit

Permalink
Remove support for stub-* files in the manifest (#18746)
Browse files Browse the repository at this point in the history
The manifest support was added in commit 2650e63,
ensuring they aren't treated as tests.

All sub-* files were removed in #18745.

We still tolerate and drop "stub" items when loading an older manifest
version until we bump the version to 7.

Part 2 of web-platform-tests/rfcs#27.
  • Loading branch information
foolip authored Sep 9, 2019
1 parent a478ac4 commit 7e484c2
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 28 deletions.
6 changes: 0 additions & 6 deletions tools/manifest/item.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,12 +329,6 @@ class VisualTest(URLManifestItem):
item_type = "visual"


class Stub(URLManifestItem):
__slots__ = ()

item_type = "stub"


class WebDriverSpecTest(URLManifestItem):
__slots__ = ()

Expand Down
11 changes: 9 additions & 2 deletions tools/manifest/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
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
Expand Down Expand Up @@ -51,7 +51,6 @@ class ManifestVersionMismatch(ManifestError):
"reftest": RefTest,
"reftest_node": RefTestNode,
"manual": ManualTest,
"stub": Stub,
"wdspec": WebDriverSpecTest,
"conformancechecker": ConformanceCheckerTest,
"visual": VisualTest,
Expand Down Expand Up @@ -471,6 +470,14 @@ def from_json(cls, tests_root, obj, types=None):
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

Expand Down
18 changes: 1 addition & 17 deletions tools/manifest/sourcefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
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

Expand Down Expand Up @@ -352,13 +352,6 @@ 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
Expand Down Expand Up @@ -793,15 +786,6 @@ def manifest_items(self):
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(
Expand Down
2 changes: 1 addition & 1 deletion tools/manifest/tests/test_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def rel_dir_file_path(draw):
@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))

Expand Down
2 changes: 1 addition & 1 deletion tools/wptrunner/wptrunner/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ def create_test_tree(metadata_path, test_manifest):
"""
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
Expand Down
1 change: 0 additions & 1 deletion tools/wptrunner/wptrunner/tests/test_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def SourceFileWithTest(path, hash, cls, *args):
"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,
Expand Down

0 comments on commit 7e484c2

Please sign in to comment.