From 1abcb47ac3e591efe2e3cae0f12f106da4511525 Mon Sep 17 00:00:00 2001 From: Aki Sasaki Date: Thu, 2 Sep 2021 18:54:30 +0000 Subject: [PATCH] Bug 1660870 - ignore non-wpt test paths in wpt. r=releng-reviewers,ahal Differential Revision: https://phabricator.services.mozilla.com/D124129 --- .../mozharness/scripts/web_platform_tests.py | 39 ++++++++++++------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/testing/mozharness/scripts/web_platform_tests.py b/testing/mozharness/scripts/web_platform_tests.py index cd09991ea8fe9..c35843fbb9060 100755 --- a/testing/mozharness/scripts/web_platform_tests.py +++ b/testing/mozharness/scripts/web_platform_tests.py @@ -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") @@ -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("/"): @@ -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"])