Skip to content

Commit

Permalink
Remove subsubtest junk when doing a full metadata update
Browse files Browse the repository at this point in the history
Differential Revision: https://phabricator.services.mozilla.com/D48894

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1583012
gecko-commit: 06b945715ba36d49882f45362533007f49465c76
gecko-integration-branch: autoland
gecko-reviewers: dheiberg
  • Loading branch information
jgraham authored and moz-wptsync-bot committed Oct 16, 2019
1 parent 35f5c5d commit 7c94080
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tools/wptrunner/wptrunner/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,11 @@ def orphan_subtests(self, expected):
expected_subtest = test.get_subtest(item)
if not self.is_disabled(expected_subtest):
rv.append(expected_subtest)
for name in seen_subtests:
subtest = test.get_subtest(name)
# If any of the items have children (ie subsubtests) we want to prune thes
if subtest.children:
rv.extend(subtest.children)

return rv

Expand Down
33 changes: 33 additions & 0 deletions tools/wptrunner/wptrunner/tests/test_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -715,6 +715,39 @@ def test_full_update():
"expected", default_run_info) == "FAIL"


@pytest.mark.xfail(sys.version[0] == "3",
reason="metadata doesn't support py3")
def test_full_orphan():
tests = [("path/to/test.htm", [test_id], "testharness",
"""[test.htm]
[test1]
expected: FAIL
[subsub test]
expected: TIMEOUT
[test2]
expected: ERROR
""")]

log_0 = suite_log([("test_start", {"test": test_id}),
("test_status", {"test": test_id,
"subtest": "test1",
"status": "FAIL",
"expected": "FAIL"}),
("test_end", {"test": test_id,
"status": "OK"})])


updated = update(tests, log_0, full_update=True)

new_manifest = updated[0][1]

assert not new_manifest.is_empty
assert len(new_manifest.get_test(test_id).children[0].children) == 0
assert new_manifest.get_test(test_id).children[0].get(
"expected", default_run_info) == "FAIL"
assert len(new_manifest.get_test(test_id).children) == 1


@pytest.mark.xfail(sys.version[0] == "3",
reason="metadata doesn't support py3")
def test_update_reorder_expected_full_conditions():
Expand Down

0 comments on commit 7c94080

Please sign in to comment.