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

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

Issue 2779053002: Ignore OWNERS files during external/wpt import and export (Closed)
Patch Set: Addressed comments Created 3 years, 9 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
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 3ad5740c1fcad03602277be53573da0714cd8916..89b9632b4e06c6b96c2746ac72aa2366b370dcfc 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer.py
@@ -233,12 +233,8 @@ class TestImporter(object):
_, show_ref_output = self.run(['git', 'show-ref', 'origin/master'], cwd=temp_repo_path)
master_commitish = show_ref_output.split()[0]
- _log.info('Cleaning out tests from LayoutTests/external/%s.', dest_dir_name)
dest_path = self.path_from_webkit_base('LayoutTests', 'external', dest_dir_name)
- is_not_baseline_filter = lambda fs, dirname, basename: not self.is_baseline(basename)
- files_to_delete = self.fs.files_under(dest_path, file_filter=is_not_baseline_filter)
- for subpath in files_to_delete:
- self.remove('LayoutTests', 'external', subpath)
+ self._clear_out_dest_path(dest_path)
_log.info('Importing the tests.')
test_copier = TestCopier(self.host, temp_repo_path)
@@ -255,6 +251,16 @@ class TestImporter(object):
return '%s@%s' % (dest_dir_name, master_commitish)
+ def _clear_out_dest_path(self, dest_path):
+ _log.info('Cleaning out tests from %s.', dest_path)
+ should_remove = lambda fs, dirname, basename: (
+ not self.is_baseline(basename) and
+ # See http://crbug.com/702283 for context.
+ basename != 'OWNERS')
+ files_to_delete = self.fs.files_under(dest_path, file_filter=should_remove)
+ for subpath in files_to_delete:
+ self.remove('LayoutTests', 'external', subpath)
+
def _commit_changes(self, commit_message):
_log.info('Committing changes.')
self.run(['git', 'commit', '--all', '-F', '-'], stdin=commit_message)

Powered by Google App Engine
This is Rietveld 408576698