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

Side by Side Diff: third_party/WebKit/Tools/PRESUBMIT.py

Issue 1780453002: [PerfTry] Make it possible to ./run_benchmark try within tools/perf (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 """Top-level presubmit script for bisect/perf trybot.
6
7 See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for
8 details on the presubmit API built into gcl.
9 """
10
11 import imp
12 import os
13
14
15 def _ExamineConfigFiles(input_api):
16 for f in input_api.AffectedFiles():
17 if (not f.LocalPath().endswith('run-perf-test.cfg')):
18 continue
19
20 try:
21 cfg_file = imp.load_source('config', os.path.basename(f.LocalPath()) )
22
23 for k, v in cfg_file.config.iteritems():
24 if v:
25 return f.LocalPath()
26 except (IOError, AttributeError, TypeError):
27 return f.LocalPath()
28
29 return None
30
31
32 def _CheckNoChangesToBisectConfigFile(input_api, output_api):
33 results = _ExamineConfigFiles(input_api)
34 if results:
35 return [output_api.PresubmitError(
36 'The perf try config file should only contain a config dict with '
37 'empty fields. Changes to this file should never be submitted.',
38 items=[results])]
39
40 return []
41
42
43 def CommonChecks(input_api, output_api):
44 results = []
45 results.extend(_CheckNoChangesToBisectConfigFile(input_api, output_api))
46 return results
47
48
49 def CheckChangeOnUpload(input_api, output_api):
50 return CommonChecks(input_api, output_api)
51
52
53 def CheckChangeOnCommit(input_api, output_api):
54 return CommonChecks(input_api, output_api)
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Tools/run-perf-test.cfg » ('j') | tools/perf/core/trybot_command.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698