Skip to content

Commit

Permalink
Bug 1660870 - ignore non-wpt test paths in wpt. r=releng-reviewers,ahal
Browse files Browse the repository at this point in the history
  • Loading branch information
escapewindow committed Sep 2, 2021
1 parent 760ddd3 commit 1abcb47
Showing 1 changed file with 26 additions and 13 deletions.
39 changes: 26 additions & 13 deletions testing/mozharness/scripts/web_platform_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,9 +375,26 @@ def _query_cmd(self, test_types):
cmd.append("--timeout-multiplier=0.25")

test_paths = set()
test_type_suite = {
"testharness": "web-platform-tests",
"crashtest": "web-platform-tests-crashtest",
"print-reftest": "web-platform-tests-print-reftest",
"reftest": "web-platform-tests-reftest",
"wdspec": "web-platform-tests-wdspec",
}
test_type_cfg = {}
all_test_suites = set()
for test_type in test_types:
test_type_cfg[test_type] = {}
(
test_type_cfg[test_type]["try_options"],
test_type_cfg[test_type]["try_tests"],
) = self.try_args(test_type_suite[test_type])
all_test_suites |= set(test_type_cfg[test_type]["try_tests"])

if not (self.verify_enabled or self.per_test_coverage):
mozharness_test_paths = json.loads(
os.environ.get("MOZHARNESS_TEST_PATHS", '""')
os.environ.get("MOZHARNESS_TEST_PATHS", '"{}"')
)
if mozharness_test_paths:
path = os.path.join(dirs["abs_fetches_dir"], "wpt_tests_by_group.json")
Expand All @@ -387,7 +404,7 @@ def _query_cmd(self, test_types):

cmd.append("--test-groups={}".format(path))

for key in mozharness_test_paths.keys():
for key in sorted(all_test_suites):
paths = mozharness_test_paths.get(key, [])
for path in paths:
if not path.startswith("/"):
Expand Down Expand Up @@ -418,23 +435,19 @@ def _query_cmd(self, test_types):
cmd.append("--webdriver-binary=%s" % geckodriver_path)
cmd.append("--webdriver-arg=-vv") # enable trace logs

test_type_suite = {
"testharness": "web-platform-tests",
"crashtest": "web-platform-tests-crashtest",
"print-reftest": "web-platform-tests-print-reftest",
"reftest": "web-platform-tests-reftest",
"wdspec": "web-platform-tests-wdspec",
}
for test_type in test_types:
try_options, try_tests = self.try_args(test_type_suite[test_type])

cmd.extend(
self.query_options(
options, try_options, str_format_values=str_format_values
options,
test_type_cfg[test_type]["try_options"],
str_format_values=str_format_values,
)
)
cmd.extend(
self.query_tests_args(try_tests, str_format_values=str_format_values)
self.query_tests_args(
test_type_cfg[test_type]["try_tests"],
str_format_values=str_format_values,
)
)
if "include" in c and c["include"]:
cmd.append("--include=%s" % c["include"])
Expand Down

0 comments on commit 1abcb47

Please sign in to comment.