OLD | NEW |
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 'recipe_engine/path', | 11 'recipe_engine/path', |
12 'recipe_engine/properties', | 12 'recipe_engine/properties', |
13 'recipe_engine/step', | 13 'recipe_engine/step', |
14 'vars', | 14 'vars', |
15 ] | 15 ] |
16 | 16 |
17 | 17 |
| 18 UPDATE_GO_ATTEMPTS = 5 |
| 19 |
| 20 |
18 def RunSteps(api): | 21 def RunSteps(api): |
19 api.vars.setup() | 22 api.vars.setup() |
20 api.core.checkout_steps() | 23 api.core.checkout_steps() |
21 | 24 |
| 25 # Attempt to update go dependencies. This fails flakily sometimes, so perform |
| 26 # multiple attempts. |
22 gopath = api.vars.checkout_root.join('gopath') | 27 gopath = api.vars.checkout_root.join('gopath') |
23 env = {'GOPATH': gopath} | 28 env = {'GOPATH': gopath} |
24 api.step('update_go_pkgs', | 29 name = 'update go pkgs' |
25 cmd=['go', 'get', '-u', 'go.skia.org/infra/...'], | 30 for attempt in xrange(UPDATE_GO_ATTEMPTS): |
26 env=env) | 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 |
27 | 42 |
| 43 # Run the infra tests. |
28 infra_tests = api.vars.skia_dir.join( | 44 infra_tests = api.vars.skia_dir.join( |
29 'infra', 'bots', 'infra_tests.py') | 45 'infra', 'bots', 'infra_tests.py') |
30 api.step('infra_tests', | 46 api.step('infra_tests', |
31 cmd=['python', infra_tests], | 47 cmd=['python', infra_tests], |
32 cwd=api.vars.skia_dir, | 48 cwd=api.vars.skia_dir, |
33 env=env) | 49 env=env) |
34 | 50 |
35 | 51 |
36 def GenTests(api): | 52 def GenTests(api): |
37 yield ( | 53 yield ( |
38 api.test('infra_tests') + | 54 api.test('infra_tests') + |
39 api.properties(buildername='Housekeeper-PerCommit-InfraTests', | 55 api.properties(buildername='Housekeeper-PerCommit-InfraTests', |
40 mastername='client.skia.fyi', | 56 mastername='client.skia.fyi', |
41 slavename='dummy-slave', | 57 slavename='dummy-slave', |
42 buildnumber=5, | 58 buildnumber=5, |
43 revision='abc123', | 59 revision='abc123', |
44 path_config='kitchen', | 60 path_config='kitchen', |
45 swarm_out_dir='[SWARM_OUT_DIR]') | 61 swarm_out_dir='[SWARM_OUT_DIR]') |
46 ) | 62 ) |
| 63 |
| 64 yield ( |
| 65 api.test('failed_one_update') + |
| 66 api.properties(buildername='Housekeeper-PerCommit-InfraTests', |
| 67 mastername='client.skia.fyi', |
| 68 slavename='dummy-slave', |
| 69 buildnumber=5, |
| 70 revision='abc123', |
| 71 path_config='kitchen', |
| 72 swarm_out_dir='[SWARM_OUT_DIR]') + |
| 73 api.step_data('update go pkgs', retcode=1) |
| 74 ) |
| 75 |
| 76 yield ( |
| 77 api.test('failed_all_updates') + |
| 78 api.properties(buildername='Housekeeper-PerCommit-InfraTests', |
| 79 mastername='client.skia.fyi', |
| 80 slavename='dummy-slave', |
| 81 buildnumber=5, |
| 82 revision='abc123', |
| 83 path_config='kitchen', |
| 84 swarm_out_dir='[SWARM_OUT_DIR]') + |
| 85 api.step_data('update go pkgs', retcode=1) + |
| 86 api.step_data('update go pkgs (attempt 2)', retcode=1) + |
| 87 api.step_data('update go pkgs (attempt 3)', retcode=1) + |
| 88 api.step_data('update go pkgs (attempt 4)', retcode=1) + |
| 89 api.step_data('update go pkgs (attempt 5)', retcode=1) |
| 90 ) |
OLD | NEW |