Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Ensure hosts are destroyed if post-suite fails
When running `rake ci:test:aio[true]`, if the post-suite failed and we're not preserving hosts, then the `beaker destroy` command would be skipped. Use a nested ensure so the failure of post-suite doesn't prevent `beaker destroy` from being called. The nested ensure also guarantees that the `post-suite` will be called even if the `pre-suite` fails, which can happen if the agent fails to install. This matches the behavior for the "non-retry" version of the `ci:test:aio` rake task. ``` $ git diff diff --git a/acceptance/teardown/common/099_Archive_Logs.rb b/acceptance/teardown/common/099_Archive_Logs.rb index d940e2bea..2302633e1 100644 --- a/acceptance/teardown/common/099_Archive_Logs.rb +++ b/acceptance/teardown/common/099_Archive_Logs.rb @@ -1,5 +1,7 @@ require 'date' +raise "whoops" + def file_glob(host, path) result = on(host, "ls #{path}", :acceptable_exit_codes => [0, 2]) return [] if result.exit_code != 0 $ export BEAKER_PUPPET_VERSION=/home/josh/work/beaker-puppet $ bundle update ... $ bundle exec rake 'ci:test:aio[true]' SHA=8.4.0 TESTS=tests/load_libfacter.rb HOSTS=hosts.yaml ... Begin teardown/common/099_Archive_Logs.rb RuntimeError: whoops ... beaker destroy ```
- Loading branch information