Skip to content
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

Add support for profiles_path #75

Conversation

brettlangdon
Copy link
Contributor

Address #66

For this change we are adding the ability to pass through profiles_path from .kitchen.yml into the Inspec::Runner.

Example verifier for .kitchen.yml:

---
verifier:
  name: inspec
  profiles_path: repo/path/to/profiles

@chef-supermarket
Copy link

Hi. I am an automated pull request bot named Curry. There are commits in this pull request whose authors are not yet authorized to contribute to Chef Software, Inc. projects or are using a non-GitHub verified email address. To become authorized to contribute, you will need to sign the Contributor License Agreement (CLA) as an individual or on behalf of your company. You can read more on Chef's blog.

GitHub Users Who Are Not Authorized To Contribute

The following GitHub users do not appear to have signed a CLA:

Please sign the CLA here.

@chef-supermarket
Copy link

Hi. Your friendly Curry bot here. Just letting you know that all commit authors have become authorized to contribute. I have added the "Signed CLA" label to this issue so it can easily be found in the future.

@brettlangdon
Copy link
Contributor Author

The test failures are due to RuboCop offenses for class length and assignment branch condition. How would you like me to resolve?

Here are the offenses:

Offenses:
lib/kitchen/verifier/inspec.rb:33:5: C: Class has too many lines. [101/100]
    class Inspec < Kitchen::Verifier::Base
    ^^^^^
lib/kitchen/verifier/inspec.rb:101:7: C: Assignment Branch Condition size for runner_options is too high. [36.89/33]
      def runner_options(transport, state = {})
      ^^^

@chris-rock
Copy link
Collaborator

suites:
  - name: contains_inspec
    run_list:
      - recipe[os_prepare]
    verifier:
      inspec_tests:
        - https://github.com/nathenharvey/tmp_compliance_profile

@brettlangdon
Copy link
Contributor Author

Yeah, what I am trying to do is reference local profiles.

Basically try to get over this error:

>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: Failed to complete #verify action: [You must supply a --profiles-path to inherit from other profiles.]
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

Some more context from me might also help. This is my .kitchen.yml:

---
driver:
  name: vagrant

provisioner:
  name: chef_zero

verifier:
  name: inspec
  profiles_path: test/profiles

platforms:
  - name: ubuntu-14.04

suites:
  - name: base
    run_list:
      - role[base]

And the directory structure looks like this:

.kitchen.yml
test
├── integration
│   ├── <suite-name>
│   │   └── *_spec.rb
└── profiles
    └── <profile>
        ├── README.md
        ├── controls
        │   ├── *.rb
        └── inspec.yml

@chris-rock
Copy link
Collaborator

Yeah, that is great. We will add a proper dependency resolution to inspec soon. That solves the problem in general :-)

@brettlangdon
Copy link
Contributor Author

\0/ yay.

Any idea on timeline for dependency resolution? And anything I can good to help out there?

@chris-rock
Copy link
Collaborator

I assume it will become mid-may :-(

@brettlangdon
Copy link
Contributor Author

Ok, is this the issue I should follow? inspec/inspec#533

@chris-rock
Copy link
Collaborator

@brettlangdon yes, exactly!

@brettlangdon
Copy link
Contributor Author

Thanks, I am content if you want to close this issue, or leave open until it is resolved. Your call.

@chris-rock
Copy link
Collaborator

I merge asap

@chris-rock chris-rock merged commit 317af4e into inspec:master Apr 12, 2016
@brettlangdon
Copy link
Contributor Author

\0/ :D thanks @chris-rock

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants