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

Unified Diff: tools/perf/PRESUBMIT.py

Issue 2654433008: Remove logic to add CQ_EXTRA_TRYBOTS on benchmark changes. (Closed)
Patch Set: Undo benchmark change. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/PRESUBMIT.py
diff --git a/tools/perf/PRESUBMIT.py b/tools/perf/PRESUBMIT.py
index ec698c423759c3178ef554603c960c790759c141..25fe5f49f644c2145c85a5e8c0c4902170a7f783 100644
--- a/tools/perf/PRESUBMIT.py
+++ b/tools/perf/PRESUBMIT.py
@@ -9,7 +9,6 @@ for more details about the presubmit API built into depot_tools.
"""
import os
-import re
import sys
@@ -96,50 +95,3 @@ def CheckChangeOnCommit(input_api, output_api):
report = []
report.extend(_CommonChecks(input_api, output_api))
return report
-
-
-def _AreBenchmarksModified(change):
- """Checks whether CL contains any modification to Telemetry benchmarks."""
- for affected_file in change.AffectedFiles():
- file_path = affected_file.LocalPath()
- # Changes to unittest files should not count.
- if file_path.endswith('test.py'):
- continue
- if (os.path.join('tools', 'perf', 'benchmarks') in file_path or
- os.path.join('tools', 'perf', 'measurements') in file_path):
- return True
- return False
-
-
-def PostUploadHook(cl, change, output_api):
- """git cl upload will call this hook after the issue is created/modified.
-
- This hook adds extra try bots list to the CL description in order to run
- Telemetry benchmarks on Perf trybots in addition to CQ trybots if the CL
- contains any changes to Telemetry benchmarks.
- """
- benchmarks_modified = _AreBenchmarksModified(change)
- rietveld_obj = cl.RpcServer()
- issue = cl.issue
- original_description = rietveld_obj.get_description(issue)
- if not benchmarks_modified or re.search(
- r'^CQ_INCLUDE_TRYBOTS=.*', original_description, re.M | re.I):
- return []
-
- results = []
- bots = [
- 'linux_perf_cq',
- 'mac_retina_perf_cq',
- 'winx64_10_perf_cq'
- ]
- bots = ['master.tryserver.chromium.perf:%s' % s for s in bots]
- bots_string = ';'.join(bots)
- description = original_description
- description += '\nCQ_INCLUDE_TRYBOTS=%s' % bots_string
- results.append(output_api.PresubmitNotifyResult(
- 'Automatically added Perf trybots to run Telemetry benchmarks on CQ.'))
-
- if description != original_description:
- rietveld_obj.update_description(issue, description)
-
- return results
« 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