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

support test suite helpers #12

Merged
merged 1 commit into from
Dec 7, 2015
Merged

Conversation

schisamo
Copy link
Contributor

Test Kitchen's default verifier, Busser, has support for loading helper files which include things like:

  • spec_helper
  • InSpec custom resources
  • RSpec shared examples
  • RSpec shared contexts
  • RSpec custom matchers

These helper files are meant to be shared amongst all test suites in a project structure like:

test/integration/
├── helpers
│   └── <VERIFIER>
│       ├── spec_helper.rb
│       └── support
│           └── some_file.rb
├── suite1
│   └── <VERIFIER>
│       └── some_spec.rb
└── suite2
    └── <VERIFIER>
         └── some_spec.rb

Some real world examples can be seen at:
https://github.com/chef-cookbooks/jenkins/tree/master/test/integration
https://github.com/chef-cookbooks/languages/tree/master/test/integration
https://github.com/chef-cookbooks/omnibus/tree/master/test/integration

This change ensures Kitchen::Verifier::Inspec fully supports these helper files!

/cc @chef/compliance @chef/engineering-services

schisamo added a commit to inspec/inspec that referenced this pull request Nov 20, 2015
This change builds on inspec/kitchen-inspec#12. All test directories should
be on the `$LOAD_PATH` when `Inspec::Runner` executes the test suites with
`RSpec::Core::Runner`. This will allow things like `require 'spec_helper'`
to work as expected.
schisamo added a commit to inspec/inspec that referenced this pull request Nov 20, 2015
This change builds on inspec/kitchen-inspec#12. All test directories should
be on the `$LOAD_PATH` when `Inspec::Runner` executes the test suites with
`RSpec::Core::Runner`. This will allow things like `require 'spec_helper'`
to work as expected.
@scotthain
Copy link

👍

@schisamo
Copy link
Contributor Author

I talked with @arlimus's in depth about this feature. We are going to hold off on merging anything for now as they have some plans to address this soon. There will be an upcoming RFC that lays out the the various options.

Test Kitchen's default verifier, Busser, has support for loading helper
files which include things like:

* spec_helper
* InSpec custom resources
* RSpec shared examples
* RSpec shared contexts
* RSpec custom matchers

These helper files are meant to be shared amongst all test suites in a
project structure like:

```
test/integration/
├── helpers
│   └── <VERIFIER>
│       ├── spec_helper.rb
│       └── support
│           └── some_file.rb
├── suite1
│   └── <VERIFIER>
│       └── some_spec.rb
└── suite2
    └── <VERIFIER>
         └── some_spec.rb
```

Some real world examples can be seen at:
https://github.com/chef-cookbooks/jenkins/tree/master/test/integration
https://github.com/chef-cookbooks/languages/tree/master/test/integration
https://github.com/chef-cookbooks/omnibus/tree/master/test/integration

This change ensures `Kitchen::Verifier::Inspec` fully supports these
helper files!
@chris-rock
Copy link
Collaborator

Thanks @schisamo that helps us to ease the Serverspec migration

chris-rock added a commit that referenced this pull request Dec 7, 2015
@chris-rock chris-rock merged commit 209d9d9 into master Dec 7, 2015
@chris-rock chris-rock deleted the schisamo/helpers-support branch December 7, 2015 10:20
@epcim
Copy link

epcim commented Jul 7, 2016

Unlikely the latest version dropped support for helper files in inspec: https://github.com/chef/kitchen-inspec/blob/master/lib/kitchen/verifier/inspec.rb

@tas50 tas50 added Type: Enhancement Adds new functionality. and removed enhancement labels Jan 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Adds new functionality.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants