inspec / kitchen-inspec

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

Default verifier location not ignored when specifying path(s) #216

Open shoekstra opened 5 years ago

shoekstra commented 5 years ago

Hi!

I recently discovered when specifying paths to tests using inspec_tests that the default expected path is still included in the tests and not sure if this is or should be desired.

My .kitchen.yml file:

  - name: default
    run_list:
      - recipe[mycookbook]
    verifier:
      inspec_tests:
        - test/integration/default/default_test.rb

  - name: selinux
    lifecycle:
      post_create:
      - remote: sudo setenforce 1
    run_list:
      - recipe[mycookbook]
    verifier:
      inspec_tests:
        - test/integration/default/selinux_test.rb
        - test/integration/default/default_test.rb

The "default" suite loads test/integration/default and test/integration/default/default_test.rb, which also loads selinux_test.rb and fails while the "selinux" suite passes successfully (as test/integration/selinux doesn't exist).

My test directory structure has been in the form of test/integration/RECIPE_NAME/ and I hadn't come across this problem until now.

Option 1 would be to move test/integration/default/selinux_test.rb to test/integration/selinux/default_test.rb, but doesn't feel right.

Option 2 would be PR to disregard default path when a path is specified.

What are the thoughts on this?

Stephen

shoekstra commented 5 years ago

Any thoughts on this one @chris-rock @adamleff?