You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running unit tests with puppetlabs_spec_helper version 6.0.3 raises an error during spec_clean due to hash['ref'] being Nil. Looking at the fixtures.rb, the validate_fixture_hash method is attempting to validate that the ref option for repositories does not contain forward slash, but it doesn't consider at all the cases where ref is not set.
As per README.md :
used to specify the tag name (like version) or commit hash to be checked out (Optional). Branch names should use the branch option instead.
Exact error when running pdk test unit :
root@02d4a589e156:/workspaces/puppet-module# pdk test unit --tests spec/classes/custom_spec.rb --puppet-version 7.27.0
pdk (INFO): Using Ruby 2.7.8
pdk (INFO): Using Puppet 7.27.0
[✖] Preparing to run the unit tests.
[✖] Cleaning up after running unit tests.
pdk (ERROR): The spec_clean rake task failed with the following error(s):
rake aborted!
NoMethodError: undefined method `include?' for nil:NilClass
Did you mean? include_repo?
/opt/puppetlabs/pdk/share/cache/ruby/2.7.0/gems/puppetlabs_spec_helper-6.0.3/lib/puppetlabs_spec_helper/tasks/fixtures.rb:154:in `validate_fixture_hash!'
/opt/puppetlabs/pdk/share/cache/ruby/2.7.0/gems/puppetlabs_spec_helper-6.0.3/lib/puppetlabs_spec_helper/tasks/fixtures.rb:136:in `block in fixtures'
/opt/puppetlabs/pdk/share/cache/ruby/2.7.0/gems/puppetlabs_spec_helper-6.0.3/lib/puppetlabs_spec_helper/tasks/fixtures.rb:120:in `each'
/opt/puppetlabs/pdk/share/cache/ruby/2.7.0/gems/puppetlabs_spec_helper-6.0.3/lib/puppetlabs_spec_helper/tasks/fixtures.rb:120:in `fixtures'
/opt/puppetlabs/pdk/share/cache/ruby/2.7.0/gems/puppetlabs_spec_helper-6.0.3/lib/puppetlabs_spec_helper/tasks/fixtures.rb:47:in `repositories'
/opt/puppetlabs/pdk/share/cache/ruby/2.7.0/gems/puppetlabs_spec_helper-6.0.3/lib/puppetlabs_spec_helper/tasks/fixtures.rb:431:in `block in <top (required)>'
/opt/puppetlabs/pdk/share/cache/ruby/2.7.0/gems/rake-13.1.0/exe/rake:27:in `<top (required)>'
Expected Behavior
This started occurring after upgrade my local PDK Docker image to the latest version. Previously not having ref specified was working without issues.
Describe the Bug
Running unit tests with
puppetlabs_spec_helper
version6.0.3
raises an error duringspec_clean
due tohash['ref']
being Nil. Looking at thefixtures.rb
, thevalidate_fixture_hash
method is attempting to validate that theref
option for repositories does not contain forward slash, but it doesn't consider at all the cases whereref
is not set.As per
README.md
:Exact error when running
pdk test unit
:Expected Behavior
This started occurring after upgrade my local PDK Docker image to the latest version. Previously not having
ref
specified was working without issues.Steps to Reproduce
Steps to reproduce the behavior:
pdk new
.fixtures.yml
the following contentpdk test unit
.Environment
Additional Context
N/A
The text was updated successfully, but these errors were encountered: