Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py

Issue 2497673003: W3C test importer: skip ref test if ref file not found. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py
index c13ea0598cc95f2d8ab260b222a8496f8b474bdc..3649c2d42293998faef2f42ce2b30daf3f057f7c 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py
@@ -255,15 +255,20 @@ class TestImporter(object):
test_basename = self.filesystem.basename(test_info['test'])
# Add the ref file, following WebKit style.
# FIXME: Ideally we'd support reading the metadata
- # directly rather than relying on a naming convention.
+ # directly rather than relying on a naming convention.
# Using a naming convention creates duplicate copies of the
- # reference files.
+ # reference files (http://crrev.com/268729).
ref_file = self.filesystem.splitext(test_basename)[0] + '-expected'
# Make sure to use the extension from the *reference*, not
# from the test, because at least flexbox tests use XHTML
# references but HTML tests.
ref_file += self.filesystem.splitext(test_info['reference'])[1]
+ if not self.filesystem.exists(test_info['reference']):
+ _log.warning('%s skipped because ref file %s was not found.',
+ path_full, ref_file)
+ continue
qyearsley 2016/11/12 00:16:33 This part is the actual main change for this CL.
+
if self.path_too_long(path_full.replace(filename, ref_file)):
_log.warning('%s skipped because path of ref file %s would be too long. '
'Max length from repo base %d chars; see http://crbug.com/609871.',
@@ -345,7 +350,7 @@ class TestImporter(object):
continue
if not self.filesystem.exists(orig_filepath):
- _log.warning('%s not found. Possible error in the test.', orig_filepath)
+ _log.error('%s not found. Possible error in the test.', orig_filepath)
qyearsley 2016/11/12 00:16:33 In theory I think we might not hit this condition
continue
new_filepath = self.filesystem.join(new_path, file_to_copy['dest'])
@@ -372,8 +377,10 @@ class TestImporter(object):
mimetype = mimetypes.guess_type(orig_filepath)
if 'is_jstest' not in file_to_copy and (
'html' in str(mimetype[0]) or 'xml' in str(mimetype[0]) or 'css' in str(mimetype[0])):
- converted_file = convert_for_webkit(new_path, filename=orig_filepath,
- reference_support_info=reference_support_info)
+ converted_file = convert_for_webkit(
+ new_path, filename=orig_filepath,
+ reference_support_info=reference_support_info,
+ host=self.host)
qyearsley 2016/11/12 00:16:33 This change makes it so that the MockFileSystem is
if not converted_file:
if not self.import_in_place and not self.options.dry_run:
@@ -385,9 +392,7 @@ class TestImporter(object):
prefixed_properties.extend(set(converted_file[0]) - set(prefixed_properties))
if not self.options.dry_run:
- outfile = open(new_filepath, 'wb')
- outfile.write(converted_file[1].encode('utf-8'))
- outfile.close()
+ self.filesystem.write_text_file(new_filepath, converted_file[1])
qyearsley 2016/11/12 00:16:33 This change makes it so that the MockFileSystem is
else:
if not self.import_in_place and not self.options.dry_run:
self.filesystem.copyfile(orig_filepath, new_filepath)
« no previous file with comments | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698