# InSpec dependencies with relative path

**URL:** <https://discourse.chef.io/t/inspec-dependencies-with-relative-path/14129>\
**Category:** Chef InSpec\
**Created:** [December 13, 2018, 11:23am UTC](https://discourse.chef.io/t/inspec-dependencies-with-relative-path/14129 "2018-12-13T11:23:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![aL1](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/al1/32/228_2.png) [@aL1](https://discourse.chef.io/u/aL1)\
**Post date:** [December 13, 2018, 11:23am UTC](https://discourse.chef.io/t/inspec-dependencies-with-relative-path/14129/1 "2018-12-13T11:23:39Z")

</div>

Hi,

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`:

```
depends:
  - 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.

---

<div class="post-metadata">

**Author:** ![misheska](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@misheska](https://discourse.chef.io/u/misheska)\
**Post date:** [December 13, 2018, 1:00pm UTC](https://discourse.chef.io/t/inspec-dependencies-with-relative-path/14129/2 "2018-12-13T13:00:35Z")

</div>

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

```auto
suites:
  - name: default
    run_list:
      - recipe[my_cookbook]
    verifier:
      inspec_tests:
        - path: ../../healthcheck/profile1
        - path: ../../healthcheck/profile2
        …
    attributes:

```

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

---

<div class="post-metadata">

**Author:** ![misheska](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@misheska](https://discourse.chef.io/u/misheska)\
**Post date:** [December 13, 2018, 1:22pm UTC](https://discourse.chef.io/t/inspec-dependencies-with-relative-path/14129/3 "2018-12-13T13:22:22Z")

</div>

I do see there was a bug filed against this with the same issue awhile ago: [https://github.com/inspec/inspec/issues/2120](https://github.com/inspec/inspec/issues/2120)

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.

---

<div class="post-metadata">

**Author:** ![aL1](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/al1/32/228_2.png) [@aL1](https://discourse.chef.io/u/aL1)\
**Post date:** [December 13, 2018, 3:04pm UTC](https://discourse.chef.io/t/inspec-dependencies-with-relative-path/14129/4 "2018-12-13T15:04:27Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![misheska](https://avatars.discourse-cdn.com/v4/letter/m/278dde/32.png) [@misheska](https://discourse.chef.io/u/misheska)\
**Post date:** [December 13, 2018, 3:13pm UTC](https://discourse.chef.io/t/inspec-dependencies-with-relative-path/14129/5 "2018-12-13T15:13:16Z")

</div>

Awesome!
