| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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 DEPS = [ | 5 DEPS = [ |
| 6 'bot_update', | 6 'bot_update', |
| 7 'chromium', | 7 'chromium', |
| 8 'file', |
| 8 'gclient', | 9 'gclient', |
| 9 'path', | 10 'path', |
| 10 'platform', | 11 'platform', |
| 11 'properties', | 12 'properties', |
| 12 'step', | 13 'step', |
| 13 'tryserver', | 14 'tryserver', |
| 14 ] | 15 ] |
| 15 | 16 |
| 16 def GenSteps(api): | 17 def GenSteps(api): |
| 17 mastername = api.properties['mastername'] | 18 mastername = api.properties['mastername'] |
| (...skipping 10 matching lines...) Expand all Loading... |
| 28 # TODO(dpranke): crbug.com/348435. We need to figure out how to separate | 29 # TODO(dpranke): crbug.com/348435. We need to figure out how to separate |
| 29 # out the retry and recovery logic from the rest of the recipe. | 30 # out the retry and recovery logic from the rest of the recipe. |
| 30 | 31 |
| 31 step_result = api.bot_update.ensure_checkout() | 32 step_result = api.bot_update.ensure_checkout() |
| 32 # The first time we run bot update, remember if bot_update mode is on or off. | 33 # The first time we run bot update, remember if bot_update mode is on or off. |
| 33 bot_update_mode = step_result.json.output['did_run'] | 34 bot_update_mode = step_result.json.output['did_run'] |
| 34 if not bot_update_mode: | 35 if not bot_update_mode: |
| 35 try: | 36 try: |
| 36 api.gclient.checkout(revert=True) | 37 api.gclient.checkout(revert=True) |
| 37 except api.step.StepFailure: | 38 except api.step.StepFailure: |
| 38 api.path.rmcontents('slave build directory', | 39 api.file.rmcontents('slave build directory', |
| 39 api.path['slave_build']) | 40 api.path['slave_build']) |
| 40 api.gclient.checkout(revert=False) | 41 api.gclient.checkout(revert=False) |
| 41 api.tryserver.maybe_apply_issue() | 42 api.tryserver.maybe_apply_issue() |
| 42 | 43 |
| 43 api.chromium.runhooks() | 44 api.chromium.runhooks() |
| 44 | 45 |
| 45 api.chromium.run_mb(mastername, buildername) | 46 api.chromium.run_mb(mastername, buildername) |
| 46 | 47 |
| 47 step_result = None | 48 step_result = None |
| 48 try: | 49 try: |
| 49 step_result = api.chromium.compile() | 50 step_result = api.chromium.compile() |
| 50 except api.step.StepFailure: | 51 except api.step.StepFailure: |
| 51 api.path.rmcontents('slave build directory', api.path['slave_build']) | 52 api.file.rmcontents('slave build directory', api.path['slave_build']) |
| 52 if bot_update_mode: | 53 if bot_update_mode: |
| 53 api.bot_update.ensure_checkout(suffix='clean') | 54 api.bot_update.ensure_checkout(suffix='clean') |
| 54 else: | 55 else: |
| 55 api.gclient.checkout(revert=False) | 56 api.gclient.checkout(revert=False) |
| 56 api.tryserver.maybe_apply_issue() | 57 api.tryserver.maybe_apply_issue() |
| 57 api.chromium.runhooks() | 58 api.chromium.runhooks() |
| 58 api.chromium.run_mb(api.properties['mastername'], | 59 api.chromium.run_mb(api.properties['mastername'], |
| 59 api.properties['buildername']) | 60 api.properties['buildername']) |
| 60 api.chromium.compile() | 61 api.chromium.compile() |
| 61 | 62 |
| (...skipping 22 matching lines...) Expand all Loading... |
| 84 api.platform.name('linux') | 85 api.platform.name('linux') |
| 85 ) | 86 ) |
| 86 | 87 |
| 87 | 88 |
| 88 yield ( | 89 yield ( |
| 89 api.test('bot_update_on') + | 90 api.test('bot_update_on') + |
| 90 api.properties.tryserver(buildername='fake_trybot_buildername', | 91 api.properties.tryserver(buildername='fake_trybot_buildername', |
| 91 mastername='bot_update.always_on') + | 92 mastername='bot_update.always_on') + |
| 92 api.step_data('compile', retcode=1) | 93 api.step_data('compile', retcode=1) |
| 93 ) | 94 ) |
| OLD | NEW |