W3C test importer should catch exceptions coming from HTML/CSS conversion
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 May 2014 16:11:12 +0000 (16:11 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 26 May 2014 16:11:12 +0000 (16:11 +0000)
https://bugs.webkit.org/show_bug.cgi?id=133176

Patch by Youenn Fablet <youenn.fablet@crf.canon.fr> on 2014-05-26
Reviewed by Darin Adler.

Exceptions raised when converting HTML/CSS are caught.
Files for which conversion failed are still copied to the target directory.
Each individual conversion failure is logged.
Total conversion failure number is logged at the end of the import process.

* Scripts/webkitpy/w3c/test_importer.py:
(TestImporter.import_tests):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169347 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/Scripts/webkitpy/w3c/test_importer.py

index a668759..d9e1285 100644 (file)
@@ -1,3 +1,18 @@
+2014-05-26  Youenn Fablet  <youenn.fablet@crf.canon.fr>
+
+        W3C test importer should catch exceptions coming from HTML/CSS conversion
+        https://bugs.webkit.org/show_bug.cgi?id=133176
+
+        Reviewed by Darin Adler.
+
+        Exceptions raised when converting HTML/CSS are caught.
+        Files for which conversion failed are still copied to the target directory.
+        Each individual conversion failure is logged.
+        Total conversion failure number is logged at the end of the import process.
+
+        * Scripts/webkitpy/w3c/test_importer.py:
+        (TestImporter.import_tests):
+
 2014-05-26  Carlos Alberto Lopez Perez  <clopez@igalia.com>
 
         [GTK] Allow to run the tests on the native X display.
index 668a01b..1e383a9 100644 (file)
@@ -310,6 +310,7 @@ class TestImporter(object):
                 os.makedirs(new_path)
 
             copied_files = []
+            failed_conversion_files = []
 
             for file_to_copy in dir_to_copy['copy_list']:
                 # FIXME: Split this block into a separate function.
@@ -342,7 +343,11 @@ class TestImporter(object):
                 # FIXME: Eventually, so should js when support is added for this type of conversion
                 mimetype = mimetypes.guess_type(orig_filepath)
                 if '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)
+                    try:
+                        converted_file = convert_for_webkit(new_path, filename=orig_filepath)
+                    except:
+                        _log.warn('Failed converting %s', orig_filepath)
+                        failed_conversion_files.append(orig_filepath)
 
                     if not converted_file:
                         shutil.copyfile(orig_filepath, new_filepath)  # The file was unmodified.
@@ -369,8 +374,11 @@ class TestImporter(object):
         _log.info('Imported %d reftests', total_imported_reftests)
         _log.info('Imported %d JS tests', total_imported_jstests)
         _log.info('Imported %d pixel/manual tests', total_imported_tests - total_imported_jstests - total_imported_reftests)
+        if len(failed_conversion_files):
+            _log.warn('Failed converting %d files (files copied without being converted)', len(failed_conversion_files))
         _log.info('')
         _log.info('Properties needing prefixes (by count):')
+
         for prefixed_property in sorted(total_prefixed_properties, key=lambda p: total_prefixed_properties[p]):
             _log.info('  %s: %s', prefixed_property, total_prefixed_properties[prefixed_property])