kitchen-inspec icon indicating copy to clipboard operation
kitchen-inspec copied to clipboard

Lifecycle Hooks Do Not Fire If InSpec Tests Fail

Open paulcalabro opened this issue 3 years ago • 1 comments

Version:

kitchen-inspec 2.4.0

Environment:

Virtual machine running Ubuntu 20.04

Scenario:

I have a post-verify lifecycle hook that is used to collect data from the virtual machine after the verification phase. It runs when the single test passes, however, it never executes when the single test fails.

Steps to Reproduce:

Include a post_verify lifecycle hook in your Test Kitchen configuration file:

lifecycle:
  post_verify:
    - <DO SOMETHING>

Create a test that always fails. Notice how the hook does not execute. Create a test that always passes. Notice how the hook does execute.

Expected Result:

Expect all command to execute regardless of test results.

Actual Result:

The commands do not execute if the test fails.

paulcalabro avatar Mar 19 '21 03:03 paulcalabro

Is there any missing information I can provide to troubleshoot this?

paulcalabro avatar May 11 '21 01:05 paulcalabro