inspec / kitchen-inspec

Test-Kitchen Plugin for InSpec
Other
109 stars 58 forks source link

Lifecycle Hooks Do Not Fire If InSpec Tests Fail #276

Open paulcalabro opened 3 years ago

paulcalabro commented 3 years ago

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 commented 3 years ago

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