Update web-platform-tests to revision 2abaf21d855986de7baa55ad52a601c489ff22fd

This commit is contained in:
WPT Sync Bot 2019-01-07 20:35:39 -05:00
parent e09e683718
commit 05d9213a6e
33 changed files with 531 additions and 95 deletions

View file

@ -338,15 +338,17 @@ class EqualTimeChunker(TestChunker):
class TestFilter(object):
def __init__(self, test_manifests, include=None, exclude=None, manifest_path=None):
if manifest_path is not None and include is None:
self.manifest = manifestinclude.get_manifest(manifest_path)
else:
def __init__(self, test_manifests, include=None, exclude=None, manifest_path=None, explicit=False):
if manifest_path is None or include or explicit:
self.manifest = manifestinclude.IncludeManifest.create()
self.manifest.set_defaults()
else:
self.manifest = manifestinclude.get_manifest(manifest_path)
if include or explicit:
self.manifest.set("skip", "true")
if include:
self.manifest.set("skip", "true")
for item in include:
self.manifest.add_include(test_manifests, item)

View file

@ -137,6 +137,11 @@ scheme host and port.""")
test_selection_group.add_argument("--tag", action="append", dest="tags",
help="Labels applied to tests to include in the run. "
"Labels starting dir: are equivalent to top-level directories.")
test_selection_group.add_argument("--default-exclude", action="store_true",
default=False,
help="Only run the tests explicitly given in arguments. "
"No tests will run if the list is empty, and the "
"program will exit with status code 0.")
debugging_group = parser.add_argument_group("Debugging")
debugging_group.add_argument('--debugger', const="__default__", nargs="?",

View file

@ -59,11 +59,12 @@ def get_loader(test_paths, product, debug=None, run_info_extras=None, **kwargs):
manifest_filters = []
meta_filters = []
if kwargs["include"] or kwargs["exclude"] or kwargs["include_manifest"]:
if kwargs["include"] or kwargs["exclude"] or kwargs["include_manifest"] or kwargs["default_exclude"]:
manifest_filters.append(testloader.TestFilter(include=kwargs["include"],
exclude=kwargs["exclude"],
manifest_path=kwargs["include_manifest"],
test_manifests=test_manifests))
test_manifests=test_manifests,
explicit=kwargs["default_exclude"]))
if kwargs["tags"]:
meta_filters.append(testloader.TagFilter(tags=kwargs["tags"]))
@ -169,7 +170,7 @@ def run_tests(config, test_paths, product, **kwargs):
test_total = 0
unexpected_total = 0
if len(test_loader.test_ids) == 0:
if len(test_loader.test_ids) == 0 and kwargs["test_list"]:
logger.error("Unable to find any tests at the path(s):")
for path in kwargs["test_list"]:
logger.error(" %s" % path)
@ -299,8 +300,12 @@ def run_tests(config, test_paths, product, **kwargs):
if skipped_tests > 0:
logger.warning("All requested tests were skipped")
else:
logger.error("No tests ran")
return False
if kwargs["default_exclude"]:
logger.info("No tests ran")
return True
else:
logger.error("No tests ran")
return False
if unexpected_total and not kwargs["fail_on_unexpected"]:
logger.info("Tolerating %s unexpected results" % unexpected_total)