Skip to content

Commit ec749e8

Browse files
jgrahammoz-wptsync-bot
authored andcommitted
Bug 1907572 [wpt PR 47114] - Fix wpt run --list-test-groups, a=testonly
Automatic update from web-platform-tests Fix wpt run --list-test-groups This was broken during the subsuite addition. However this fix also slightly changes the behaviour; now we list the _actual_ test groups, not just the first element of the URL. The previous behaviour is nearly equivalent to passing in --run-by-dir=1 with no defined subsuites, although the new output will have an additional leading / on each group name. -- wpt-commits: 4cf18483bcb940e52a49b2230a80210ce298ee7d wpt-pr: 47114
1 parent ffd267a commit ec749e8

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

testing/web-platform/tests/tools/wptrunner/wptrunner/testloader.py

-10
Original file line numberDiff line numberDiff line change
@@ -497,16 +497,6 @@ def _load_tests(self):
497497
self.tests = tests_enabled
498498
self.disabled_tests = tests_disabled
499499

500-
def groups(self, test_types, chunk_type="none", total_chunks=1, chunk_number=1):
501-
groups = set()
502-
503-
for test_type in test_types:
504-
for test in self.tests[test_type]:
505-
group = test.url.split("/")[1]
506-
groups.add(group)
507-
508-
return groups
509-
510500

511501

512502
def get_test_queue_builder(**kwargs: Any) -> Tuple[TestQueueBuilder, Mapping[str, Any]]:

testing/web-platform/tests/tools/wptrunner/wptrunner/wptrunner.py

+8-4
Original file line numberDiff line numberDiff line change
@@ -128,11 +128,15 @@ def get_loader(test_paths: wptcommandline.TestPaths,
128128
def list_test_groups(test_paths, product, **kwargs):
129129
env.do_delayed_imports(logger, test_paths)
130130

131-
_, test_loader = get_loader(test_paths,
132-
product,
133-
**kwargs)
131+
test_queue_builder, test_loader = get_loader(test_paths,
132+
product,
133+
**kwargs)
134134

135-
for item in sorted(test_loader.groups(kwargs["test_types"])):
135+
tests_by_type = {(subsuite_name, test_type): tests
136+
for subsuite_name, subsuite_tests in test_loader.tests.items()
137+
for test_type, tests in subsuite_tests.items()}
138+
139+
for item in sorted(test_queue_builder.tests_by_group(tests_by_type)):
136140
print(item)
137141

138142

0 commit comments

Comments
 (0)