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

Side by Side Diff: infra/bots/recipes/swarm_infra.py

Issue 2444883002: Add infra recipe module, use for updating Go DEPS (Closed)
Patch Set: Created 4 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 | « infra/bots/recipes/swarm_RecreateSKPs.expected/Housekeeper-Weekly-RecreateSKPs.json ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 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 5
6 # Recipe which runs the Skia infra tests. 6 # Recipe which runs the Skia infra tests.
7 7
8 8
9 DEPS = [ 9 DEPS = [
10 'core', 10 'core',
11 'infra',
11 'recipe_engine/path', 12 'recipe_engine/path',
12 'recipe_engine/properties', 13 'recipe_engine/properties',
13 'recipe_engine/step', 14 'recipe_engine/step',
15 'run',
14 'vars', 16 'vars',
15 ] 17 ]
16 18
17 19
18 UPDATE_GO_ATTEMPTS = 5
19
20
21 def RunSteps(api): 20 def RunSteps(api):
22 api.vars.setup() 21 api.vars.setup()
23 api.core.checkout_steps() 22 api.core.checkout_steps()
24 23 api.infra.update_go_deps()
25 # Attempt to update go dependencies. This fails flakily sometimes, so perform
26 # multiple attempts.
27 gopath = api.vars.checkout_root.join('gopath')
28 env = {'GOPATH': gopath}
29 name = 'update go pkgs'
30 for attempt in xrange(UPDATE_GO_ATTEMPTS):
31 step_name = name
32 if attempt > 0:
33 step_name += ' (attempt %d)' % (attempt + 1)
34 try:
35 api.step(step_name,
36 cmd=['go', 'get', '-u', 'go.skia.org/infra/...'],
37 env=env)
38 break
39 except api.step.StepFailure:
40 if attempt == UPDATE_GO_ATTEMPTS - 1:
41 raise
42 24
43 # Run the infra tests. 25 # Run the infra tests.
44 infra_tests = api.vars.skia_dir.join( 26 infra_tests = api.vars.skia_dir.join(
45 'infra', 'bots', 'infra_tests.py') 27 'infra', 'bots', 'infra_tests.py')
46 api.step('infra_tests', 28 api.step('infra_tests',
47 cmd=['python', infra_tests], 29 cmd=['python', infra_tests],
48 cwd=api.vars.skia_dir, 30 cwd=api.vars.skia_dir,
49 env=env) 31 env=api.infra.go_env)
50 32
51 33
52 def GenTests(api): 34 def GenTests(api):
53 yield ( 35 yield (
54 api.test('infra_tests') + 36 api.test('infra_tests') +
55 api.properties(buildername='Housekeeper-PerCommit-InfraTests', 37 api.properties(buildername='Housekeeper-PerCommit-InfraTests',
56 mastername='client.skia.fyi', 38 mastername='client.skia.fyi',
57 slavename='dummy-slave', 39 slavename='dummy-slave',
58 buildnumber=5, 40 buildnumber=5,
59 revision='abc123', 41 revision='abc123',
(...skipping 21 matching lines...) Expand all
81 buildnumber=5, 63 buildnumber=5,
82 revision='abc123', 64 revision='abc123',
83 path_config='kitchen', 65 path_config='kitchen',
84 swarm_out_dir='[SWARM_OUT_DIR]') + 66 swarm_out_dir='[SWARM_OUT_DIR]') +
85 api.step_data('update go pkgs', retcode=1) + 67 api.step_data('update go pkgs', retcode=1) +
86 api.step_data('update go pkgs (attempt 2)', retcode=1) + 68 api.step_data('update go pkgs (attempt 2)', retcode=1) +
87 api.step_data('update go pkgs (attempt 3)', retcode=1) + 69 api.step_data('update go pkgs (attempt 3)', retcode=1) +
88 api.step_data('update go pkgs (attempt 4)', retcode=1) + 70 api.step_data('update go pkgs (attempt 4)', retcode=1) +
89 api.step_data('update go pkgs (attempt 5)', retcode=1) 71 api.step_data('update go pkgs (attempt 5)', retcode=1)
90 ) 72 )
OLDNEW
« no previous file with comments | « infra/bots/recipes/swarm_RecreateSKPs.expected/Housekeeper-Weekly-RecreateSKPs.json ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698