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
In a MayTheSourceBeWithYou rubocop clean up I attempted to clean Style/ClassAndModuleChildren on this repository, and found that for puppet modules, the rubocop is configured for compact, but if you do class Puppet::Util::IniFile instead of module Puppet:Util\n class IniFile tests fail with a NameErroruninitialized constant Puppet::Util::IniFile to which @binford2k suggested I make a ticket because "Maybe raise a ticket for someone to investigate because basically what this means is that this is being loaded before Puppet's fully initialized and that seems potentially problematic too."
Expected Behavior
I expected to have tests run successfully
What I got
pdk (INFO): Using Ruby 2.7.7
pdk (INFO): Using Puppet 7.23.0
[✔] Preparing to run the unit tests.
/opt/puppetlabs/pdk/private/ruby/2.7.7/bin/ruby -I/home/jstraw/.pdk/cache/ruby/2.7.0/gems/rspec-core-3.12.2/lib:/opt/puppetlabs/pdk/share/cache/ruby/2.7.0/gems/rspec-support-3.12.0/lib /home/jstraw/.pdk/cache/ruby/2.7.0/gems/rspec-core-3.12.2/exe/rspec --pattern spec/\{aliases,classes,defines,functions,hosts,integration,plans,tasks,type_aliases,types,unit\}/\*\*/\*_spec.rb --format progress
An error occurred while loading ./spec/unit/puppet/provider/ini_setting/inheritance_spec.rb.
Failure/Error: class Puppet::Util::IniFile::Section
Puppet::Error:
Could not autoload puppet/type/inherit_ini_setting: Could not autoload puppet/provider/inherit_ini_setting/ini_setting: Could not autoload puppet/type/ini_setting: Could not autoload puppet/provider/ini_setting/ruby: uninitialized constant Puppet::Util::IniFile
# ./lib/puppet/util/ini_file/section.rb:6:in `<top (required)>'
# ./lib/puppet/util/ini_file.rb:4:in `<top (required)>'
# ./lib/puppet/provider/ini_setting/ruby.rb:3:in `<top (required)>'
# ./lib/puppet/type/ini_setting.rb:6:in `<top (required)>'
# ./spec/fixtures/inherit_ini_setting/lib/puppet/provider/inherit_ini_setting/ini_setting.rb:3:in `<top (required)>'
# ./spec/fixtures/inherit_ini_setting/lib/puppet/type/inherit_ini_setting.rb:1:in `<top (required)>'
# ./spec/unit/puppet/provider/ini_setting/inheritance_spec.rb:9:in `<top (required)>'
# ------------------
# --- Caused by: ---
# NameError:
# uninitialized constant Puppet::Util::IniFile
# ./lib/puppet/util/ini_file/section.rb:6:in `<top (required)>'
An error occurred while loading ./spec/unit/puppet/provider/ini_setting/ruby_spec.rb.
Failure/Error: class Puppet::Util::IniFile::Section
Puppet::Error:
Could not autoload puppet/provider/ini_setting/ruby: uninitialized constant Puppet::Util::IniFile
# ./lib/puppet/util/ini_file/section.rb:6:in `<top (required)>'
# ./lib/puppet/util/ini_file.rb:4:in `<top (required)>'
# ./lib/puppet/provider/ini_setting/ruby.rb:3:in `<top (required)>'
# ./spec/unit/puppet/provider/ini_setting/ruby_spec.rb:6:in `<top (required)>'
# ------------------
# --- Caused by: ---
# NameError:
# uninitialized constant Puppet::Util::IniFile
# ./lib/puppet/util/ini_file/section.rb:6:in `<top (required)>'
An error occurred while loading ./spec/unit/puppet/provider/ini_subsetting/ruby_spec.rb.
Failure/Error: class Puppet::Util::IniFile::Section
Puppet::Error:
Could not autoload puppet/type/ini_subsetting: Could not autoload puppet/provider/ini_subsetting/ruby: uninitialized constant Puppet::Util::IniFile
# ./lib/puppet/util/ini_file/section.rb:6:in `<top (required)>'
# ./lib/puppet/util/ini_file.rb:4:in `<top (required)>'
# ./lib/puppet/provider/ini_subsetting/ruby.rb:3:in `<top (required)>'
# ./lib/puppet/type/ini_subsetting.rb:5:in `<top (required)>'
# ./spec/unit/puppet/provider/ini_subsetting/ruby_spec.rb:6:in `<top (required)>'
# ------------------
# --- Caused by: ---
# NameError:
# uninitialized constant Puppet::Util::IniFile
# ./lib/puppet/util/ini_file/section.rb:6:in `<top (required)>'
An error occurred while loading ./spec/unit/puppet/util/ini_file_spec.rb.
Failure/Error: class Puppet::Util::IniFile::Section
NameError:
uninitialized constant Puppet::Util::IniFile
# ./lib/puppet/util/ini_file/section.rb:6:in `<top (required)>'
# ./lib/puppet/util/ini_file.rb:4:in `<top (required)>'
# ./spec/unit/puppet/util/ini_file_spec.rb:5:in `<top (required)>'```
## Steps to Reproduce
Steps to reproduce the behavior:
1. Remove the disable of the rubocop for Style/ClassAndModuleChildren
2. Update the 4 classes in question using either autocorrect or manually (using concise rather then nested)
3. run pdk validate and find that the rubocop is no longer failing
4. run pdk test unit and get the errors above
## Environment
- PDK 2.7.1
- (Module on 2.7.0)
- Debian Testing
The text was updated successfully, but these errors were encountered:
Describe the Bug
In a MayTheSourceBeWithYou rubocop clean up I attempted to clean Style/ClassAndModuleChildren on this repository, and found that for puppet modules, the rubocop is configured for compact, but if you do
class Puppet::Util::IniFile
instead ofmodule Puppet:Util\n class IniFile
tests fail with a NameErroruninitialized constant Puppet::Util::IniFile
to which @binford2k suggested I make a ticket because "Maybe raise a ticket for someone to investigate because basically what this means is that this is being loaded before Puppet's fully initialized and that seems potentially problematic too."Expected Behavior
I expected to have tests run successfully
What I got
The text was updated successfully, but these errors were encountered: