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

Unified Diff: tools/perf/core/trybot_command.py

Issue 2400003002: Remove CL upload logic from Perf Try Job workflow. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 2 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 | tools/perf/core/trybot_command_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/core/trybot_command.py
diff --git a/tools/perf/core/trybot_command.py b/tools/perf/core/trybot_command.py
index 86fe1cf4bd1fbc4987fc3c057a97bbab371d3881..f4c5adb115e539c82975ea8cb2bfe02bd8d09dfc 100644
--- a/tools/perf/core/trybot_command.py
+++ b/tools/perf/core/trybot_command.py
@@ -446,8 +446,8 @@ E.g.,
output = RunGit(['diff-index', 'HEAD'])
if output:
raise TrybotError(
- 'Cannot send a try job with a dirty tree. Please commit '
- 'your changes locally first in %s repository.' % repo_path)
+ 'Cannot send a try job with a dirty tree.\nPlease commit locally and '
+ 'upload your changes to rietveld in %s repository.' % repo_path)
# Make sure the tree does have local commits.
sullivan 2016/10/07 14:50:07 I think we actually don't care about this now as l
prasadv1 2016/10/07 23:06:09 Done.
output = RunGit(['footers', 'HEAD'])
@@ -501,6 +501,19 @@ E.g.,
raise TrybotError('URL %s on remote %s is not recognized on branch.'% (
cur_remote_url, cur_remote))
+ def _GetChangeList(self):
+ """Gets the codereview URL for the current changes."""
+ output = RunGit(['cl', 'issue'],
+ 'Failed to run "git cl issue" command.')
+ match = re.search(r'https://codereview.chromium.org/[\d]+', output)
Michael Achenbach 2016/10/07 15:31:12 This looks like it is rietveld only. Please make s
tandrii(chromium) 2016/10/07 15:41:51 Please, use --json flag and don't parse human mess
prasadv1 2016/10/07 23:06:09 Done.
prasadv1 2016/10/07 23:06:09 Done. Now using git cl issue --json arg to get the
+ # Make sure the local commits are uploaded to rietveld.
+ if not match:
+ raise TrybotError(
+ 'PLEASE NOTE: The workflow for Perf Try jobs is changed. '
+ 'In order to run the perf try job, you must first upload your '
+ 'changes to rietveld.')
+ return match.group(0)
+
def _AttemptTryjob(self, options, extra_args):
"""Attempts to run a tryjob from a repo directory.
@@ -533,10 +546,8 @@ E.g.,
branch_name, repo_info.get('url'))
deps_override = {repo_info.get('src'): options.deps_revision}
- arguments = [options.benchmark_name] + extra_args
-
- rietveld_url = self._UploadPatchToRietveld(repo_name, options)
- print ('\nUploaded try job to rietveld.\nview progress here %s.'
+ rietveld_url = self._GetChangeList()
+ print ('\nRunning try job....\nview progress here %s.'
'\n\tRepo Name: %s\n\tPath: %s\n\tBranch: %s' % (
rietveld_url, repo_name, repo_path, branch_name))
@@ -545,6 +556,7 @@ E.g.,
logging.warning('No builder is found for %s', bot_platform)
continue
try:
+ arguments = [options.benchmark_name] + extra_args
self._RunTryJob(bot_platform, arguments, deps_override)
# Even if git cl try throws TrybotError exception for any platform,
# keep sending try jobs to other platforms.
@@ -558,20 +570,6 @@ E.g.,
os.chdir(original_workdir)
return 0
- def _UploadPatchToRietveld(self, repo_name, options):
- """Uploads the patch to rietveld and returns rietveld URL."""
- output = RunGit(['cl', 'upload', '-f', '--bypass-hooks', '-m',
- ('CL for %s perf tryjob to run %s benchmark '
- 'on %s platform(s)' % (
- repo_name, options.benchmark_name, options.trybot))],
- 'Could not upload to rietveld for %s' % repo_name)
-
- match = re.search(r'https://codereview.chromium.org/[\d]+', output)
- if not match:
- raise TrybotError('Could not upload CL to rietveld for %s! Output %s' %
- (repo_name, output))
- return match.group(0)
-
def _RunTryJob(self, bot_platform, arguments, deps_override):
tandrii(chromium) 2016/10/07 15:44:36 this code as is will work with Gerrit too (support
"""Executes perf try job with benchmark test properties.
« no previous file with comments | « no previous file | tools/perf/core/trybot_command_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698