inspec / kitchen-inspec

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

junit(2) is not a valid reporter type #272

Closed wyardley closed 3 years ago

wyardley commented 3 years ago

Sorry if this should be in inspec instead (feel free to move if necessary), but still having some difficulties with junit reports. Let me know if the verifier needs to be configured differently somehow.

Version:

kitchen-inspec 2.3.0 inspec(-bin) 4.26.0

Environment:

MacOS X, Linux

Scenario:

I'm still having issues similar to https://github.com/inspec/inspec/issues/5243

Steps to Reproduce:

bundle exec kitchen verify my config currently looks like this:

provisioner:
  name: "terraform"

platforms:
  - name: local

verifier:
  name: terraform
  systems:
    - name: remote-gcp
      backend: gcp
      reporter:
        - progress
        - json:/tmp/remote_gcp_inspec.json
        - junit2:/tmp/remote_gcp_inspec.xml
      controls:
        - foo
        - bar
    - name: local-outputs
      backend: local
      reporter:
        - progress
        - json:/tmp/local_inspec.json
      controls:
        - foo
        - bar

Expected Result:

inspec produces a junit report

Actual Result:

>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>>     Failed to complete #verify action: ['junit' is not a valid reporter type.] on default-local

Same error whether I specify junit or junit2.

clintoncwolfe commented 3 years ago

I just ran this again using (only) kitchen-inspec - without kitchen-terraform, and it worked correctly. Notice that when you use kitchen-terraform, you are using a different verifier, not kitchen-inspec - kitchen-terraform uses inspec in a couple of different ways.

I believe that kitchen-terraform may need to be modified to trigger loading the plugins before calling the runner for the first time.

wyardley commented 3 years ago

got it - I will open a request under kitchen-terraform, then.

If I used the inspec verifier directly, I'm guessing that might also work?