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

Fails with facterdb 0.8.1 #3

Open
baurmatt opened this issue Aug 12, 2019 · 1 comment · May be fixed by #4
Open

Fails with facterdb 0.8.1 #3

baurmatt opened this issue Aug 12, 2019 · 1 comment · May be fixed by #4

Comments

@baurmatt
Copy link

baurmatt commented Aug 12, 2019

$ bundle exec rspec spec/classes/failures_spec.rb:101
Failed to retrieve Augeas version: cannot load such file -- augeas
Shuffling unsupported OS's facts with seed: 32216
Set environment variable to reproduce this order, for ex. on Linux `export RSPEC_PUPPET_FACTS_UNSUPPORTED_ORDER=32216`

An error occurred while loading ./spec/classes/failures_spec.rb.
Failure/Error:
  on_unsupported_os.each do |os, os_facts|
    context "with unsupported #{os}" do
      let(:facts) do
        os_facts.merge(
          'sys11_ipaddress_private' => sys11_ipaddress_private,
          'memory' => {
            'system' => {
              'total_bytes' => memory_total_bytes,
            },
          },

NoMethodError:
  undefined method `downcase' for nil:NilClass
# /Users/mbaur/.rvm/gems/ruby-2.5.3/gems/rspec-puppet-facts-unsupported-0.1.1/lib/rspec-puppet-facts-unsupported/on_unsupported_os.rb:268:in `describe_os'
# /Users/mbaur/.rvm/gems/ruby-2.5.3/gems/rspec-puppet-facts-unsupported-0.1.1/lib/rspec-puppet-facts-unsupported/on_unsupported_os.rb:251:in `block in postprocess_facts'
# /Users/mbaur/.rvm/gems/ruby-2.5.3/gems/rspec-puppet-facts-unsupported-0.1.1/lib/rspec-puppet-facts-unsupported/on_unsupported_os.rb:250:in `map'
# /Users/mbaur/.rvm/gems/ruby-2.5.3/gems/rspec-puppet-facts-unsupported-0.1.1/lib/rspec-puppet-facts-unsupported/on_unsupported_os.rb:250:in `postprocess_facts'
# /Users/mbaur/.rvm/gems/ruby-2.5.3/gems/rspec-puppet-facts-unsupported-0.1.1/lib/rspec-puppet-facts-unsupported/on_unsupported_os.rb:232:in `facts'
# /Users/mbaur/.rvm/gems/ruby-2.5.3/gems/rspec-puppet-facts-unsupported-0.1.1/lib/rspec-puppet-facts-unsupported/on_unsupported_os.rb:27:in `on_unsupported_os'
# ./spec/classes/failures_spec.rb:101:in `block in <top (required)>'
# ./spec/classes/failures_spec.rb:6:in `<top (required)>'
Run options: include {:locations=>{"./spec/classes/failures_spec.rb"=>[101]}}
Total resources:   0
Touched resources: 0
Resource coverage:   NaN%


Finished in 0.00134 seconds (files took 5.27 seconds to load)
0 examples, 0 failures, 1 error occurred outside of examples

This happens because of new SLES 15 SP1 fact sets which got introduced with 0.8.1 (voxpupuli/facterdb#121). Those fact sets don't have a "operatingsystem" set because facter 2.5 can't retrieve it. As facter 2.5 is deprecated and get soon replaced by Facter NG (https://groups.io/g/voxpupuli/message/302) it would be great if we could simply fail safely in rspec-puppet-facts-unsupported.

@baurmatt
Copy link
Author

I will provide a PR.

baurmatt added a commit to syseleven/rspec-puppet-facts-unsupported that referenced this issue Aug 12, 2019
facterdb 0.8.1 introduced a SLES 15 SP1 fact set which doesn't have a
operatingsystem fact. This is due to bugs in facter 2.5. As facter 2.5
doesn't get maintance anymore, we need to fail safely here.

Fixes coi-gov-pl#3.
baurmatt added a commit to syseleven/rspec-puppet-facts-unsupported that referenced this issue Aug 13, 2019
facterdb 0.8.1 introduced a SLES 15 SP1 fact set which doesn't have a
operatingsystem fact. This is due to bugs in facter 2.5. As facter 2.5
doesn't get maintance anymore, we need to fail safely here.

Fixes coi-gov-pl#3.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant