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

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

Issue 1970963002: Check for and skip long paths when importing w3c tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add more explanation of the limit & change limit to 125 Created 4 years, 7 months 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 93fa7d01c4b52e91b18b253d2e24017877699eaa..f7def61946f1d075ecf61d58a709e3ec23f86884 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py
@@ -87,6 +87,12 @@ 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.
+# This limit is here because the Windows builders cannot create paths that are
+# longer than the Windows max path length (260). See http://crbug.com/609871.
+MAX_PATH_LENGTH = 125
+
+
_log = logging.getLogger(__name__)
@@ -180,6 +186,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):
@@ -344,6 +351,11 @@ 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 skipped (longer than %d chars), to avoid hitting Windows max path length on builders.',
Dirk Pranke 2016/05/13 18:01:41 I'd actually include the bug number in the message
qyearsley 2016/05/13 21:45:19 Done now.
+ orig_filepath, MAX_PATH_LENGTH)
+ continue
+
new_filepath = self.filesystem.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']
@@ -403,6 +415,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 """
« 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