Commit 9ff2a639 authored by Luke Zielinski's avatar Luke Zielinski Committed by Commit Bot

WPT Metadata builder bugfix - don't try to split the path for a test if the...

WPT Metadata builder bugfix - don't try to split the path for a test if the manifest returns None for that test name.

Also added a unit test for this.

TBR=robertma@chromium.org

Change-Id: I45f2a1f2ff9380446e28d599337d22cf89830fa8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1897952Reviewed-by: default avatarLuke Z <lpz@chromium.org>
Commit-Queue: Luke Z <lpz@chromium.org>
Auto-Submit: Luke Z <lpz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712180}
parent cf1a15a1
...@@ -171,11 +171,11 @@ class WPTMetadataBuilder(object): ...@@ -171,11 +171,11 @@ class WPTMetadataBuilder(object):
# For individual tests, we create one file per test, with the name # For individual tests, we create one file per test, with the name
# of the test in the file as well. This name can contain variants. # of the test in the file as well. This name can contain variants.
test_file_path = self.wpt_manifest.file_path_for_test_url(wpt_test_name) test_file_path = self.wpt_manifest.file_path_for_test_url(wpt_test_name)
test_file_parts = test_file_path.split("/")
if not test_file_path: if not test_file_path:
_log.info("Could not find file for test %s, skipping" % wpt_test_name) _log.info("Could not find file for test %s, skipping" % wpt_test_name)
return None, None return None, None
test_file_parts = test_file_path.split("/")
# Append `.ini` to the test filename to indicate it's the metadata # Append `.ini` to the test filename to indicate it's the metadata
# file. The `test_filename` can differ from the `wpt_test_name` for # file. The `test_filename` can differ from the `wpt_test_name` for
# multi-global tests. # multi-global tests.
......
...@@ -102,6 +102,15 @@ class WPTMetadataBuilderTest(unittest.TestCase): ...@@ -102,6 +102,15 @@ class WPTMetadataBuilderTest(unittest.TestCase):
self.assertIsNone(filename) self.assertIsNone(filename)
self.assertIsNone(contents) self.assertIsNone(contents)
def test_wpt_test_without_manifest_entry(self):
"""A WPT test that is not in the manifest should not get a baseline."""
test_name = "external/wpt/test-not-in-manifest.html"
expectations = _make_expectation(self.port, test_name, "SKIP")
metadata_builder = WPTMetadataBuilder(expectations, self.port)
filename, contents = metadata_builder.get_metadata_filename_and_contents(test_name, 'SKIP')
self.assertIsNone(filename)
self.assertIsNone(contents)
def test_wpt_test_not_skipped(self): def test_wpt_test_not_skipped(self):
"""A WPT test that is not skipped should not get a SKIP metadata.""" """A WPT test that is not skipped should not get a SKIP metadata."""
test_name = "external/wpt/test.html" test_name = "external/wpt/test.html"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment