Skip to content

Commit

Permalink
Bug 1439853 [wpt PR 9598] - Update reftests in manifest when reftests…
Browse files Browse the repository at this point in the history
… become non-reftests, a=testonly

Automatic update from web-platform-testsUpdate reftests in manifest when reftests become non-reftests (#9598)

In web-platform-tests/wpt#9523 some tests were
converted from reftests to testharness, but the incremental manifest
update mechanism doesn't handle this case. This appears to be the cause
of the mysterious Travis failures on that PR.

The added test failed without the code changes.

wpt-commits: 86195076e37a960ff44fa86edc54699455f3a4aa
wpt-pr: 9598
wpt-commits: 86195076e37a960ff44fa86edc54699455f3a4aa
wpt-pr: 9598
  • Loading branch information
foolip authored and jgraham committed Mar 31, 2018
1 parent 01216fc commit eb4d2c1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions testing/web-platform/tests/tools/manifest/manifest.py
Expand Up @@ -91,6 +91,8 @@ def update(self, tree):
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:
reftest_changes = True
else:
new_type, manifest_items = source_file.manifest_items()

Expand Down
22 changes: 22 additions & 0 deletions testing/web-platform/tests/tools/manifest/tests/test_manifest.py
Expand Up @@ -232,6 +232,28 @@ def test_reftest_computation_chain_update_remove():
assert list(m) == [("reftest", test2.path, {test2})]


def test_reftest_computation_chain_update_test_type():
m = manifest.Manifest()

s1 = SourceFileWithTest("test", "0"*40, item.RefTest, [("/test-ref", "==")])

assert m.update([s1]) is True

test1 = s1.manifest_items()[1][0]

assert list(m) == [("reftest", test1.path, {test1})]

# test becomes a testharness test (hash change because that is determined
# based on the file contents). The updated manifest should not includes the
# old reftest.
s2 = SourceFileWithTest("test", "1"*40, item.TestharnessTest)
assert m.update([s2]) is True

test2 = s2.manifest_items()[1][0]

assert list(m) == [("testharness", test2.path, {test2})]


def test_iterpath():
m = manifest.Manifest()

Expand Down

0 comments on commit eb4d2c1

Please sign in to comment.