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

Side by Side Diff: tools/telemetry/PRESUBMIT.py

Issue 659293003: Switch telemetry over to use typ to run the unit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@rev_typ_v086
Patch Set: fix merge error in browser_test_case Created 6 years, 1 month 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 | « tools/perf/run_tests ('k') | tools/telemetry/bootstrap_deps » ('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 2012 The Chromium Authors. All rights reserved. 1 # Copyright 2012 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 import os 4 import os
5 import sys 5 import sys
6 6
7 PYLINT_BLACKLIST = [] 7 PYLINT_BLACKLIST = []
8 PYLINT_DISABLED_WARNINGS = ['R0923', 'R0201', 'E1101'] 8 PYLINT_DISABLED_WARNINGS = ['R0923', 'R0201', 'E1101']
9 9
10 def _CommonChecks(input_api, output_api): 10 def _CommonChecks(input_api, output_api):
(...skipping 15 matching lines...) Expand all
26 checker = presubmit_checker.PresubmitChecker(input_api, output_api) 26 checker = presubmit_checker.PresubmitChecker(input_api, output_api)
27 results += checker.RunChecks() 27 results += checker.RunChecks()
28 28
29 results.extend(input_api.canned_checks.RunPylint( 29 results.extend(input_api.canned_checks.RunPylint(
30 input_api, output_api, 30 input_api, output_api,
31 black_list=PYLINT_BLACKLIST, 31 black_list=PYLINT_BLACKLIST,
32 disabled_warnings=PYLINT_DISABLED_WARNINGS)) 32 disabled_warnings=PYLINT_DISABLED_WARNINGS))
33 return results 33 return results
34 34
35 def GetPathsToPrepend(input_api): 35 def GetPathsToPrepend(input_api):
36 return [input_api.PresubmitLocalPath()] 36 return [input_api.PresubmitLocalPath(),
37 os.path.join(input_api.PresubmitLocalPath(), os.path.pardir,
38 os.path.pardir, 'third_party', 'typ')]
37 39
38 def RunWithPrependedPath(prepended_path, fn, *args): 40 def RunWithPrependedPath(prepended_path, fn, *args):
39 old_path = sys.path 41 old_path = sys.path
40 42
41 try: 43 try:
42 sys.path = prepended_path + old_path 44 sys.path = prepended_path + old_path
43 return fn(*args) 45 return fn(*args)
44 finally: 46 finally:
45 sys.path = old_path 47 sys.path = old_path
46 48
47 def CheckChangeOnUpload(input_api, output_api): 49 def CheckChangeOnUpload(input_api, output_api):
48 def go(): 50 def go():
49 results = [] 51 results = []
50 results.extend(_CommonChecks(input_api, output_api)) 52 results.extend(_CommonChecks(input_api, output_api))
51 return results 53 return results
52 return RunWithPrependedPath(GetPathsToPrepend(input_api), go) 54 return RunWithPrependedPath(GetPathsToPrepend(input_api), go)
53 55
54 def CheckChangeOnCommit(input_api, output_api): 56 def CheckChangeOnCommit(input_api, output_api):
55 def go(): 57 def go():
56 results = [] 58 results = []
57 results.extend(_CommonChecks(input_api, output_api)) 59 results.extend(_CommonChecks(input_api, output_api))
58 return results 60 return results
59 return RunWithPrependedPath(GetPathsToPrepend(input_api), go) 61 return RunWithPrependedPath(GetPathsToPrepend(input_api), go)
OLDNEW
« no previous file with comments | « tools/perf/run_tests ('k') | tools/telemetry/bootstrap_deps » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698