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

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

Issue 2639283005: Add NOEXPORT=true commit message whenever import script is run. (Closed)
Patch Set: Add test for NOEXPORT tag movement 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 | third_party/WebKit/Tools/Scripts/webkitpy/w3c/deps_updater_unittest.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Fetches a copy of the latest state of a W3C test repository and commits. 5 """Fetches a copy of the latest state of a W3C test repository and commits.
6 6
7 If this script is given the argument --auto-update, it will also: 7 If this script is given the argument --auto-update, it will also:
8 1. Upload a CL. 8 1. Upload a CL.
9 2. Trigger try jobs and wait for them to complete. 9 2. Trigger try jobs and wait for them to complete.
10 3. Make any changes that are required for new failing tests. 10 3. Make any changes that are required for new failing tests.
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 220
221 def _commit_changes(self, commit_message): 221 def _commit_changes(self, commit_message):
222 _log.info('Committing changes.') 222 _log.info('Committing changes.')
223 self.run(['git', 'commit', '--all', '-F', '-'], stdin=commit_message) 223 self.run(['git', 'commit', '--all', '-F', '-'], stdin=commit_message)
224 224
225 def _has_changes(self): 225 def _has_changes(self):
226 return_code, _ = self.run(['git', 'diff', '--quiet', 'HEAD'], exit_on_fa ilure=False) 226 return_code, _ = self.run(['git', 'diff', '--quiet', 'HEAD'], exit_on_fa ilure=False)
227 return return_code == 1 227 return return_code == 1
228 228
229 def _commit_message(self, chromium_commit, import_commit): 229 def _commit_message(self, chromium_commit, import_commit):
230 return ('Import %s\n\nUsing update-w3c-deps in Chromium %s.\n\n' % 230 return ('Import %s\n\n'
231 'Using update-w3c-deps in Chromium %s.\n\n'
232 'NOEXPORT=true' %
231 (import_commit, chromium_commit)) 233 (import_commit, chromium_commit))
232 234
233 @staticmethod 235 @staticmethod
234 def is_baseline(basename): 236 def is_baseline(basename):
235 return basename.endswith('-expected.txt') 237 return basename.endswith('-expected.txt')
236 238
237 def run(self, cmd, exit_on_failure=True, cwd=None, stdin=''): 239 def run(self, cmd, exit_on_failure=True, cwd=None, stdin=''):
238 _log.debug('Running command: %s', ' '.join(cmd)) 240 _log.debug('Running command: %s', ' '.join(cmd))
239 241
240 cwd = cwd or self.finder.webkit_base() 242 cwd = cwd or self.finder.webkit_base()
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 '-m', 333 '-m',
332 description, 334 description,
333 ] + ['--cc=' + email for email in cc_list]) 335 ] + ['--cc=' + email for email in cc_list])
334 336
335 def _cl_description(self): 337 def _cl_description(self):
336 description = self.check_run(['git', 'log', '-1', '--format=%B']) 338 description = self.check_run(['git', 'log', '-1', '--format=%B'])
337 build_link = self._build_link() 339 build_link = self._build_link()
338 if build_link: 340 if build_link:
339 description += 'Build: %s\n\n' % build_link 341 description += 'Build: %s\n\n' % build_link
340 description += 'TBR=qyearsley@chromium.org\n' 342 description += 'TBR=qyearsley@chromium.org\n'
343 # Move any NOEXPORT tag to the end of the description.
344 description = description.replace('NOEXPORT=true', '')
341 description += 'NOEXPORT=true' 345 description += 'NOEXPORT=true'
342 return description 346 return description
343 347
344 def _build_link(self): 348 def _build_link(self):
345 """Returns a link to a job, if running on buildbot.""" 349 """Returns a link to a job, if running on buildbot."""
346 master_name = self.host.environ.get('BUILDBOT_MASTERNAME') 350 master_name = self.host.environ.get('BUILDBOT_MASTERNAME')
347 builder_name = self.host.environ.get('BUILDBOT_BUILDERNAME') 351 builder_name = self.host.environ.get('BUILDBOT_BUILDERNAME')
348 build_number = self.host.environ.get('BUILDBOT_BUILDNUMBER') 352 build_number = self.host.environ.get('BUILDBOT_BUILDNUMBER')
349 if not (master_name and builder_name and build_number): 353 if not (master_name and builder_name and build_number):
350 return None 354 return None
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
443 """Returns a dict mapping source to dest name for layout tests that have been renamed.""" 447 """Returns a dict mapping source to dest name for layout tests that have been renamed."""
444 out = self.check_run(['git', 'diff', 'origin/master', '-M100%', '--diff- filter=R', '--name-status']) 448 out = self.check_run(['git', 'diff', 'origin/master', '-M100%', '--diff- filter=R', '--name-status'])
445 renamed_tests = {} 449 renamed_tests = {}
446 for line in out.splitlines(): 450 for line in out.splitlines():
447 _, source_path, dest_path = line.split() 451 _, source_path, dest_path = line.split()
448 source_test = self.finder.layout_test_name(source_path) 452 source_test = self.finder.layout_test_name(source_path)
449 dest_test = self.finder.layout_test_name(dest_path) 453 dest_test = self.finder.layout_test_name(dest_path)
450 if source_test and dest_test: 454 if source_test and dest_test:
451 renamed_tests[source_test] = dest_test 455 renamed_tests[source_test] = dest_test
452 return renamed_tests 456 return renamed_tests
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Tools/Scripts/webkitpy/w3c/deps_updater_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698