Chromium Code Reviews| 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 222f20cee78f7aa46e0ea1b4bcd64ef87d90d419..238b893d22c97cc89d30e13a8a96bbe4a8529293 100644 |
| --- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py |
| +++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py |
| @@ -90,6 +90,9 @@ from webkitpy.w3c.test_converter import convert_for_webkit |
| CHANGESET_NOT_AVAILABLE = 'Not Available' |
| +# Maximum length of import path starting from top of source repository. |
| +MAX_PATH_LENGTH = 110 |
|
Dirk Pranke
2016/05/12 00:53:23
Please say in the comment (and the error message)
qyearsley
2016/05/13 16:51:20
More explanation added now.
|
| + |
| _log = logging.getLogger(__name__) |
| @@ -180,6 +183,7 @@ class TestImporter(object): |
| def load_changeset(self): |
| """Returns the current changeset from mercurial or "Not Available".""" |
| + # TODO(qyearsley): Remove this, since mercurial isn't used for w3c repos any more, so this is not applicable. |
| try: |
| self.changeset = self.host.executive.run_command(['hg', 'tip']).split('changeset:')[1] |
| except (OSError, ScriptError): |
| @@ -345,6 +349,9 @@ class TestImporter(object): |
| _log.warning('%s not found. Possible error in the test.', orig_filepath) |
| continue |
| + if self.path_too_long(orig_filepath): |
| + _log.warning('%s is too long. Skipping.', orig_filepath) |
| + |
| new_filepath = os.path.join(new_path, file_to_copy['dest']) |
| if 'reference_support_info' in file_to_copy.keys() and file_to_copy['reference_support_info'] != {}: |
| reference_support_info = file_to_copy['reference_support_info'] |
| @@ -404,6 +411,15 @@ class TestImporter(object): |
| 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]) |
| + def path_too_long(self, source_path): |
| + """Checks whether a source path is too long to import. |
| + |
| + Args: |
| + Absolute path of file to be imported. |
| + """ |
| + path_from_repo_base = os.path.relpath(source_path, self.top_of_repo) |
| + return len(path_from_repo_base) > MAX_PATH_LENGTH |
| + |
| def setup_destination_directory(self): |
| """ Creates a destination directory that mirrors that of the source directory """ |