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

uninitialised constant Kitchen::Verifier::Inspec::Hashie when declaring inputs #242

Open
walterdolce opened this issue Oct 9, 2019 · 8 comments
Labels
Type: Bug Doesn't work as expected. Type: Chore non-critical maintenance of a project.

Comments

@walterdolce
Copy link
Contributor

Version:

# Gemfile
source 'https://rubygems.org'

gem 'kitchen-ansible', '0.48.8'
gem 'kitchen-inspec', '1.2.0'
gem 'kitchen-vagrant', '1.3.4'
gem 'inspec-bin', '4.17.17'

Environment:

macOS

Scenario:

Trying to run bundle exec kitchen verify

Steps to Reproduce:

Create a .kitchen.yml and add the following bits to it:

verifier:
  name: inspec
  inputs:
    # make this an attribute required by one of the inspec tests below
    foo: bar
  inspec_tests:
  - path: ./path/to/some/inspec/tests

platforms:
  - name: ubuntu-16.04
    box: bento/ubuntu-16.04
    box_version: 201808.24.0

suites:
  - name: default

Expected Result:

test-kitchen fires the inspec verifier as normal (doesn't matter whether the tests pass or not)

Actual Result:

-----> Starting Kitchen (v1.25.0)
-----> Verifying <default-ubuntu-1604>...
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>>     Failed to complete #verify action: [uninitialized constant Kitchen::Verifier::Inspec::Hashie] on default-ubuntu-1604
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

[What actually happens after the reproduction steps?]

Note: by commenting out the inputs section, the problem goes away. I can run inspec normally.

@walterdolce
Copy link
Contributor Author

More to the above, which will hopefully help speeding up the resolution for this...

The problem is around here: https://github.com/inspec/kitchen-inspec/blob/master/lib/kitchen/verifier/inspec.rb#L121-L125

@walterdolce
Copy link
Contributor Author

Hold on fire on this. It might be my machine which is misconfigured 😒
Closing for now while I investigate further. Will reopen if needed...

@walterdolce
Copy link
Contributor Author

walterdolce commented Oct 9, 2019

OK. I cleared my system of all the versions of Ruby I had installed with rbenv, leaving only one and the problem persists. Reopening.

@walterdolce walterdolce reopened this Oct 9, 2019
@walterdolce
Copy link
Contributor Author

Adding require "hashie" fixes the problem. I assume no unit/integration tests were in place for this scenario.

I'm going to PR this soon.

@gekitsuu
Copy link

I'm having this issue too

@kekaichinose kekaichinose added Type: Bug Doesn't work as expected. Type: Chore non-critical maintenance of a project. labels Oct 14, 2019
@dlerch-transporeon
Copy link

same issue here

@walterdolce
Copy link
Contributor Author

PR is ready. Just need maintainers to review & accept. Use my branch in the meantime if that's blocking you.

@gekitsuu
Copy link

Bump

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Doesn't work as expected. Type: Chore non-critical maintenance of a project.
Projects
None yet
Development

No branches or pull requests

4 participants