Bug 1634554 - Part 2: pass file containing MOZHARNESS_TEST_PATHS to web-platform-tests harness r=ahal,jgraham

Changes:
  - if MOZHARNESS_TEST_PATHS is defined, write the contents of that directory to a JSON file.
  - append `--run-by-dir` only if `--test-groups` flag is not set.

Differential Revision: https://phabricator.services.mozilla.com/D78820
This commit is contained in:
Edwin Takahashi 2020-06-15 18:32:03 +00:00
parent 0c1148f15a
commit 783151f608

View File

@ -241,7 +241,6 @@ class WebPlatformTest(TestingMixin, MercurialScript, CodeCoverageMixin, AndroidM
"--symbols-path=%s" % self.symbols_path,
"--stackwalk-binary=%s" % self.query_minidump_stackwalk(),
"--stackfix-dir=%s" % os.path.join(dirs["abs_test_install_dir"], "bin"),
"--run-by-dir=%i" % (3 if not mozinfo.info["asan"] else 0),
"--no-pause-after-test",
"--instrument-to-file=%s" % os.path.join(dirs["abs_blob_upload_dir"],
"wpt_instruments.txt")]
@ -285,9 +284,15 @@ class WebPlatformTest(TestingMixin, MercurialScript, CodeCoverageMixin, AndroidM
if not (self.verify_enabled or self.per_test_coverage):
mozharness_test_paths = json.loads(os.environ.get('MOZHARNESS_TEST_PATHS', '""'))
if mozharness_test_paths:
keys = (['web-platform-tests-%s' % test_type for test_type in test_types] +
['web-platform-tests'])
for key in keys:
path = os.path.join(
dirs["abs_fetches_dir"], 'wpt_tests_by_group.json')
if not os.path.exists(path):
self.critical('Unable to locate web-platform-test groups file.')
cmd.append("--test-groups={}".format(path))
for key in mozharness_test_paths.keys():
paths = mozharness_test_paths.get(key, [])
for path in paths:
if not path.startswith("/"):
@ -298,6 +303,9 @@ class WebPlatformTest(TestingMixin, MercurialScript, CodeCoverageMixin, AndroidM
path = os.path.join(dirs["abs_wpttest_dir"], path)
test_paths.add(path)
else:
# As per WPT harness, the --run-by-dir flag is incompatible with
# the --test-groups flag.
cmd.append("--run-by-dir=%i" % (3 if not mozinfo.info["asan"] else 0))
for opt in ["total_chunks", "this_chunk"]:
val = c.get(opt)
if val: