-
Notifications
You must be signed in to change notification settings - Fork 680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support profiles not at root level of a git repository #2167
Comments
@Poohblah the profile must be in The recommended practice is to place your profiles in separate git repos, and they can either inherit from each other, or they may each be listed in the Therefore, I'm afraid I'm not clear on what the exact issue is. Can you please be more specific? |
So the desire here is: as a cookbook author, I want to write cookbooks with integration tests, and as a consumer of those cookbooks, I want to be able to consume their tests.
Yes, but then if I put my profile in the top-level directory of my cookbook so that I may export my profile, the
Technically that works, but I'd really prefer not to have my tests divorced from the things they are testing. By default, ChefSpec/ServerSpec/InSpec tests live in the same cookbook repository as the cookbook they are testing, which I think is best behavior. |
OK, so let me try to understand the real issue here as I feel we've conflated your particular use case with how InSpec works vs. how Test Kitchen works... In Cookbook A, stored in its own git repo, you have a In Cookbook B, you wish to consume the profile from Did I accurately sum up your particular use case? |
That is an accurate summation! :) |
Phew! OK. So I think what we need to do is turn this issue into a feature request that looks like this: Title: Support profiles not at root level of a git repository
How does that sound? If that sounds good, would you please modify the issue accordingly? I'm happy to do so as well but would like us to agree on what you're looking for. |
Updated. Thanks for taking the time to make sure we were both on the same page! |
This should be closed if the above PR gets merged, given this I'm going to remove the assignment to me. |
This is a duplicate of #1974 |
Please add the ability to specify a relative path when using the
git
fetcher such that InSpec can support using a profile in a repo where the repo is not at the root directory, such as a Chef cookbook used by Test Kitchen, or a repository that contains multiple profiles.(The above is an updated description of this feature request. Below is the original description.)
This was discussed briefly in inspec/kitchen-inspec#66 and determined to be a new issue.
When including a profile from an
inspec.yml
file, InSpec expects the included profile to live in top-level directories in the referenced git repository/tarball/path.When writing a profile to be used with TestKitchen, specifically with kitchen-inspec, the profile must live in a subdirectory called
test/integration/$suite/inspec
.Because of this discrepancy, it's impossible to write a profile that can be run with TestKitchen and also exported for use by other profiles.
The text was updated successfully, but these errors were encountered: