diff options
author | anandc <anandc@chromium.org> | 2015-04-01 15:08:32 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-01 22:08:56 +0000 |
commit | 8d9ecbaac4ad09086c89e517f123818a34d24c0a (patch) | |
tree | 59fff300428719852dd0ab2614a68530493924b3 /testing/chromoting/browser_tests_launcher.py | |
parent | 47ffb57bb5c14c3e8fae1ff444c4a2e255d73c27 (diff) | |
download | chromium_src-8d9ecbaac4ad09086c89e517f123818a34d24c0a.zip chromium_src-8d9ecbaac4ad09086c89e517f123818a34d24c0a.tar.gz chromium_src-8d9ecbaac4ad09086c89e517f123818a34d24c0a.tar.bz2 |
Stop host and clean-up user-profile dir even on test failures.
BUG=
Review URL: https://codereview.chromium.org/1045163002
Cr-Commit-Position: refs/heads/master@{#323336}
Diffstat (limited to 'testing/chromoting/browser_tests_launcher.py')
-rw-r--r-- | testing/chromoting/browser_tests_launcher.py | 44 |
1 files changed, 23 insertions, 21 deletions
diff --git a/testing/chromoting/browser_tests_launcher.py b/testing/chromoting/browser_tests_launcher.py index ee1fe38..da7bbac 100644 --- a/testing/chromoting/browser_tests_launcher.py +++ b/testing/chromoting/browser_tests_launcher.py @@ -133,23 +133,7 @@ def SetupUserProfileDir(me2me_manifest_file, it2me_manifest_file, shutil.copyfile(manifest_file_src, manifest_file_dest) -def main(): - parser = argparse.ArgumentParser() - parser.add_argument('-f', '--commands_file', - help='path to file listing commands to be launched.') - parser.add_argument('-p', '--prod_dir', - help='path to folder having product and test binaries.') - parser.add_argument('-c', '--cfg_file', - help='path to test host config file.') - parser.add_argument('--me2me_manifest_file', - help='path to me2me host manifest file.') - parser.add_argument('--it2me_manifest_file', - help='path to it2me host manifest file.') - parser.add_argument( - '-u', '--user_profile_dir', - help='path to user-profile-dir, used by connect-to-host tests.') - - args = parser.parse_args() +def main(args): InitialiseTestMachineForLinux(args.cfg_file) @@ -178,8 +162,26 @@ def main(): if TEST_FAILURE: raise Exception('At least one test failed.') - # Now, stop host, and cleanup user-profile-dir - TestCleanUp(args.user_profile_dir) - if __name__ == '__main__': - main() + + parser = argparse.ArgumentParser() + parser.add_argument('-f', '--commands_file', + help='path to file listing commands to be launched.') + parser.add_argument('-p', '--prod_dir', + help='path to folder having product and test binaries.') + parser.add_argument('-c', '--cfg_file', + help='path to test host config file.') + parser.add_argument('--me2me_manifest_file', + help='path to me2me host manifest file.') + parser.add_argument('--it2me_manifest_file', + help='path to it2me host manifest file.') + parser.add_argument( + '-u', '--user_profile_dir', + help='path to user-profile-dir, used by connect-to-host tests.') + command_line_args = parser.parse_args() + try: + main(command_line_args) + finally: + # Stop host and cleanup user-profile-dir. + TestCleanUp(command_line_args.user_profile_dir) + |