InSpec dependencies with relative path



I have a problem using relative path on an profile dependency . It works with inspec check but complains not found, trying a "wrong" path when i run kitchen verify.

My suite is called server so my main profile. Then i have secondary profile called profile1 and i have this lines on tes/integration/server/inspec.yml:

  - name: profile1
    path: ../profile1

The path should be relative to inspec.yml but kitchen verify looks for the profile relative to the cookbook path. Complaining with:

No such file or directory

This worked before, and cant find any doc about how to implement relative path on dependencies between profiles.


I do relative dependencies in my .kitchen.yml using the path array under verifier/inspec_tests like so:

  - name: default
      - recipe[my_cookbook]
        - path: ../../healthcheck/profile1
        - path: ../../healthcheck/profile2

This was buried somewhere in the inspec docs I think. In the opposite direction by listing multiple relative paths in my .kitchen.yml


I do see there was a bug filed against this with the same issue awhile ago:

It doesn’t look like it landed.

I believe I remember noticing the same difference as well, so I inverted my dependencies to control them from Test Kitchen.


I finally figured it out. Dont know why (until now it was working) you have to vendor the profile that have the dependecy defined on inspec.yml:

inspec vendor --overwrite test/integration/myprofile

Once that is done, a test/integration/myprofile/inspec.lock file is created and kitchen verify mysuite worked like a charm.

Thanks to @frezbo on #inspec channel at slack!