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

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

Issue 2654873003: Make logging in test_importer.py quieter. (Closed)
Patch Set: Created 3 years, 11 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 1 # Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
2 # 2 #
3 # Redistribution and use in source and binary forms, with or without 3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions 4 # modification, are permitted provided that the following conditions
5 # are met: 5 # are met:
6 # 6 #
7 # 1. Redistributions of source code must retain the above 7 # 1. Redistributions of source code must retain the above
8 # copyright notice, this list of conditions and the following 8 # copyright notice, this list of conditions and the following
9 # disclaimer. 9 # disclaimer.
10 # 2. Redistributions in binary form must reproduce the above 10 # 2. Redistributions in binary form must reproduce the above
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 def find_importable_tests(self): 89 def find_importable_tests(self):
90 """Walks through the source directory to find what tests should be impor ted. 90 """Walks through the source directory to find what tests should be impor ted.
91 91
92 This function sets self.import_list, which contains information about ho w many 92 This function sets self.import_list, which contains information about ho w many
93 tests are being imported, and their source and destination paths. 93 tests are being imported, and their source and destination paths.
94 """ 94 """
95 paths_to_skip = self.find_paths_to_skip() 95 paths_to_skip = self.find_paths_to_skip()
96 96
97 for root, dirs, files in self.filesystem.walk(self.source_repo_path): 97 for root, dirs, files in self.filesystem.walk(self.source_repo_path):
98 cur_dir = root.replace(self.dir_above_repo + '/', '') + '/' 98 cur_dir = root.replace(self.dir_above_repo + '/', '') + '/'
99 _log.info(' scanning ' + cur_dir + '...') 99 _log.debug(' scanning ' + cur_dir + '...')
100 total_tests = 0 100 total_tests = 0
101 reftests = 0 101 reftests = 0
102 jstests = 0 102 jstests = 0
103 103
104 # Files in 'tools' are not for browser testing, so we skip them. 104 # Files in 'tools' are not for browser testing, so we skip them.
105 # See: http://testthewebforward.org/docs/test-format-guidelines.html #tools 105 # See: http://testthewebforward.org/docs/test-format-guidelines.html #tools
106 dirs_to_skip = ('.git', 'test-plan', 'tools') 106 dirs_to_skip = ('.git', 'test-plan', 'tools')
107 107
108 # We copy all files in 'support', including HTML without metadata. 108 # We copy all files in 'support', including HTML without metadata.
109 # See: http://testthewebforward.org/docs/test-format-guidelines.html #support-files 109 # See: http://testthewebforward.org/docs/test-format-guidelines.html #support-files
110 dirs_to_include = ('resources', 'support') 110 dirs_to_include = ('resources', 'support')
111 111
112 if dirs: 112 if dirs:
113 for name in dirs_to_skip: 113 for name in dirs_to_skip:
114 if name in dirs: 114 if name in dirs:
115 dirs.remove(name) 115 dirs.remove(name)
116 116
117 for path in paths_to_skip: 117 for path in paths_to_skip:
118 path_base = path.replace(self.dest_dir_name + '/', '') 118 path_base = path.replace(self.dest_dir_name + '/', '')
119 path_base = path_base.replace(cur_dir, '') 119 path_base = path_base.replace(cur_dir, '')
120 path_full = self.filesystem.join(root, path_base) 120 path_full = self.filesystem.join(root, path_base)
121 if path_base in dirs: 121 if path_base in dirs:
122 dirs.remove(path_base) 122 dirs.remove(path_base)
123 if self.import_in_place: 123 if self.import_in_place:
124 _log.info(" pruning %s", path_base) 124 _log.debug(' pruning %s', path_base)
125 self.filesystem.rmtree(path_full) 125 self.filesystem.rmtree(path_full)
126 else: 126 else:
127 _log.info(" skipping %s", path_base) 127 _log.debug(' skipping %s', path_base)
128 128
129 copy_list = [] 129 copy_list = []
130 130
131 for filename in files: 131 for filename in files:
132 path_full = self.filesystem.join(root, filename) 132 path_full = self.filesystem.join(root, filename)
133 path_base = path_full.replace(self.source_repo_path + '/', '') 133 path_base = path_full.replace(self.source_repo_path + '/', '')
134 path_base = self.destination_directory.replace(self.layout_tests _dir + '/', '') + '/' + path_base 134 path_base = self.destination_directory.replace(self.layout_tests _dir + '/', '') + '/' + path_base
135 if path_base in paths_to_skip: 135 if path_base in paths_to_skip:
136 if self.import_in_place: 136 if self.import_in_place:
137 _log.info(" pruning %s", path_base) 137 _log.debug(' pruning %s', path_base)
138 self.filesystem.remove(path_full) 138 self.filesystem.remove(path_full)
139 continue 139 continue
140 else: 140 else:
141 continue 141 continue
142 # FIXME: This block should really be a separate function, but th e early-continues make that difficult. 142 # FIXME: This block should really be a separate function, but th e early-continues make that difficult.
143 143
144 if filename.startswith('.') or filename.endswith('.pl'): 144 if filename.startswith('.') or filename.endswith('.pl'):
145 # The w3cs repos may contain perl scripts, which we don't ca re about. 145 # The w3cs repos may contain perl scripts, which we don't ca re about.
146 continue 146 continue
147 if filename == 'OWNERS' or filename == 'reftest.list': 147 if filename == 'OWNERS' or filename == 'reftest.list':
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 reference_support_info = file_to_copy.get('reference_support_info') or N one 301 reference_support_info = file_to_copy.get('reference_support_info') or N one
302 302
303 if not self.filesystem.exists(self.filesystem.dirname(dest_path)): 303 if not self.filesystem.exists(self.filesystem.dirname(dest_path)):
304 if not self.import_in_place: 304 if not self.import_in_place:
305 self.filesystem.maybe_make_directory(self.filesystem.dirname(des t_path)) 305 self.filesystem.maybe_make_directory(self.filesystem.dirname(des t_path))
306 306
307 relpath = self.filesystem.relpath(dest_path, self.layout_tests_dir) 307 relpath = self.filesystem.relpath(dest_path, self.layout_tests_dir)
308 # FIXME: Maybe doing a file diff is in order here for existing files? 308 # FIXME: Maybe doing a file diff is in order here for existing files?
309 # In other words, there's no sense in overwriting identical files, but 309 # In other words, there's no sense in overwriting identical files, but
310 # there's no harm in copying the identical thing. 310 # there's no harm in copying the identical thing.
311 _log.info(' %s', relpath) 311 _log.debug(' copying %s', relpath)
312 312
313 if self.should_try_to_convert(file_to_copy, source_path, dest_dir): 313 if self.should_try_to_convert(file_to_copy, source_path, dest_dir):
314 converted_file = convert_for_webkit( 314 converted_file = convert_for_webkit(
315 dest_dir, filename=source_path, 315 dest_dir, filename=source_path,
316 reference_support_info=reference_support_info, 316 reference_support_info=reference_support_info,
317 host=self.host) 317 host=self.host)
318 for prefixed_property in converted_file[0]: 318 for prefixed_property in converted_file[0]:
319 self._prefixed_properties.setdefault(prefixed_property, 0) 319 self._prefixed_properties.setdefault(prefixed_property, 0)
320 self._prefixed_properties[prefixed_property] += 1 320 self._prefixed_properties[prefixed_property] += 1
321 321
(...skipping 25 matching lines...) Expand all
347 """Checks whether a source path is too long to import. 347 """Checks whether a source path is too long to import.
348 348
349 Args: 349 Args:
350 Absolute path of file to be imported. 350 Absolute path of file to be imported.
351 351
352 Returns: 352 Returns:
353 True if the path is too long to import, False if it's OK. 353 True if the path is too long to import, False if it's OK.
354 """ 354 """
355 path_from_repo_base = os.path.relpath(source_path, self.source_repo_path ) 355 path_from_repo_base = os.path.relpath(source_path, self.source_repo_path )
356 return len(path_from_repo_base) > MAX_PATH_LENGTH 356 return len(path_from_repo_base) > MAX_PATH_LENGTH
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698