inspec / kitchen-inspec

Test-Kitchen Plugin for InSpec
Other
109 stars 58 forks source link

Incorrect lower bound specification for `inspec` dependency #253

Closed satyanash closed 4 years ago

satyanash commented 4 years ago

The gemspec specifies the following bounds for the inspec gem:

spec.add_dependency "inspec", ">= 1.47", "< 5.0"

However, we have the following require clause in lib/kitchen/verifier/inspec.rb:

...
require "inspec/plugin/v2"
...

The inspec/plugin/v2 directory in the inspec project was first introduced in v2.2.64 of inspec. Thus, at least that version should be our lower bound for the supported inspec version. The current lower bound of >= 1.47 is incorrect.

satyanash commented 4 years ago

My current setup resolves this to the following combination:

    kitchen-inspec (1.3.2)
    ...
    inspec (2.1.0)

Which is valid as per the gemspec for kitchen-inspec. But I get the following error when I try to use the above combination of gems:

Kitchen: Message: Could not load the 'inspec' verifier from the load path.cannot load such file -- inspec/plugin/v2
satyanash commented 4 years ago

Cross posting here, for visibility. When using Ruby 2.3, the above error can be worked around, with the following versioning setup:

kitchen-inspec  (1.3.1)
kitchen-dokken  (2.9.0)
test-kitchen    (2.5.1)
inspec          (3.9.3)

The specific locks being inspec at 3.9.3 as it is the last supported version for Ruby 2.3, and kitchen-inspec at 1.3.1. Version 1.3.2 seems to be the one that introduces the error.