Bug 1442216 [wpt PR 9732] - Update reftest graph when node changes to support, a=testonly

Automatic update from web-platform-testsUpdate reftest graph when node changes to support (#9732)

Modified conditional in manifest.py to check for a reftest node changing
to another type.
Wrote a test in test_manifest.py for the same

wpt-commits: 2560d71e083b5798154038589205f75f54442601
wpt-pr: 9732
wpt-commits: 2560d71e083b5798154038589205f75f54442601
wpt-pr: 9732
This commit is contained in:
Ahilya Sinha 2018-03-26 14:50:11 +00:00 committed by James Graham
parent 430380d6b1
commit 089c21ef83
2 changed files with 25 additions and 1 deletions

View File

@ -91,7 +91,7 @@ class Manifest(object):
hash_changed = True
else:
new_type, manifest_items = old_type, self._data[old_type][rel_path]
if old_type == "reftest" and new_type != old_type:
if old_type in ("reftest", "reftest_node") and new_type != old_type:
reftest_changes = True
else:
new_type, manifest_items = source_file.manifest_items()

View File

@ -254,6 +254,30 @@ def test_reftest_computation_chain_update_test_type():
assert list(m) == [("testharness", test2.path, {test2})]
def test_reftest_computation_chain_update_node_change():
m = manifest.Manifest()
s1 = SourceFileWithTest("test1", "0"*40, item.RefTest, [("/test2", "==")])
s2 = SourceFileWithTest("test2", "0"*40, item.RefTestNode, [("/test3", "==")])
assert m.update([s1, s2]) is True
test1 = s1.manifest_items()[1][0]
test2 = s2.manifest_items()[1][0]
assert list(m) == [("reftest", test1.path, {test1}),
("reftest_node", test2.path, {test2})]
#test2 changes to support type
s2 = SourceFileWithTest("test2", "1"*40, item.SupportFile)
assert m.update([s1,s2]) is True
test3 = s2.manifest_items()[1][0]
assert list(m) == [("reftest", test1.path, {test1}),
("support", test3.path, {test3})]
def test_iterpath():
m = manifest.Manifest()