kitchen-inspec icon indicating copy to clipboard operation
kitchen-inspec copied to clipboard

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

Open walterdolce opened this issue 5 years ago • 8 comments

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 avatar Oct 09 '19 11:10 walterdolce

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 avatar Oct 09 '19 11:10 walterdolce

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 avatar Oct 09 '19 11:10 walterdolce

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 avatar Oct 09 '19 11:10 walterdolce

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.

walterdolce avatar Oct 09 '19 12:10 walterdolce

I'm having this issue too

gekitsuu avatar Oct 14 '19 03:10 gekitsuu

same issue here

dlerch-transporeon avatar Oct 15 '19 08:10 dlerch-transporeon

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

walterdolce avatar Oct 15 '19 10:10 walterdolce

Bump

gekitsuu avatar Oct 25 '19 19:10 gekitsuu