Chromium Code Reviews| Index: build/android/buildbot/bb_device_steps.py |
| diff --git a/build/android/buildbot/bb_device_steps.py b/build/android/buildbot/bb_device_steps.py |
| index 9ec3fe3dcf48579350e651343a303660d74ec79b..56937223d0ff87cf41f65f5afa89773e720f11e6 100755 |
| --- a/build/android/buildbot/bb_device_steps.py |
| +++ b/build/android/buildbot/bb_device_steps.py |
| @@ -320,35 +320,43 @@ def GenerateTestReport(options): |
| os.remove(report) |
| +def KillHostHeartbeat(_): |
| + # PostTestStepCmds take an option argument, but the provision script doesn't |
| + # need options to kill the host heartbeat. |
| + provision_devices.KillHostHeartbeat() |
| + |
| + |
| def GetPostTestStepCmds(): |
| return [ |
| ('logcat_dump', LogcatDump), |
| - ('test_report', GenerateTestReport) |
| + ('test_report', GenerateTestReport), |
| + ('kill_host_heartbeat', KillHostHeartbeat) |
| ] |
| def MainTestWrapper(options): |
| - # Spawn logcat monitor |
| - SpawnLogcatMonitor() |
| - |
| - # Run all device setup steps |
| - for _, cmd in GetDeviceSetupStepCmds(): |
| - cmd(options) |
| + try: |
| + # Spawn logcat monitor |
| + SpawnLogcatMonitor() |
| - if options.install: |
| - test_obj = INSTRUMENTATION_TESTS[options.install] |
| - InstallApk(options, test_obj, print_step=True) |
| + # Run all device setup steps |
| + for _, cmd in GetDeviceSetupStepCmds(): |
| + cmd(options) |
| - if options.test_filter: |
| - bb_utils.RunSteps(options.test_filter, GetTestStepCmds(), options) |
| + if options.install: |
| + test_obj = INSTRUMENTATION_TESTS[options.install] |
| + InstallApk(options, test_obj, print_step=True) |
| - if options.experimental: |
| - RunTestSuites(options, gtest_config.EXPERIMENTAL_TEST_SUITES) |
| - RunBrowserTestSuite(options) |
| + if options.test_filter: |
| + bb_utils.RunSteps(options.test_filter, GetTestStepCmds(), options) |
| - # Run all post test steps |
| - for _, cmd in GetPostTestStepCmds(): |
| - cmd(options) |
| + if options.experimental: |
| + RunTestSuites(options, gtest_config.EXPERIMENTAL_TEST_SUITES) |
| + RunBrowserTestSuite(options) |
| + finally: |
|
Isaac (away)
2013/08/02 02:20:26
Could we just call the functions here and remove G
navabi
2013/08/02 16:26:43
Sure. That way we also don't need KillHostHeartbea
|
| + # Run all post test steps |
| + for _, cmd in GetPostTestStepCmds(): |
| + cmd(options) |
| def GetDeviceStepsOptParser(): |
| @@ -392,7 +400,6 @@ def main(argv): |
| setattr(options, 'target', options.factory_properties.get('target', 'Debug')) |
| MainTestWrapper(options) |
| - provision_devices.KillHostHeartbeat() |
|
navabi
2013/08/02 00:29:32
This moved to GetPostTestStepCmds.
|
| if __name__ == '__main__': |