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

Unit tests broken for facter 2.5 #338

Closed
baurmatt opened this issue Jul 19, 2017 · 3 comments
Closed

Unit tests broken for facter 2.5 #338

baurmatt opened this issue Jul 19, 2017 · 3 comments
Assignees
Labels
Milestone

Comments

@baurmatt
Copy link
Contributor

baurmatt commented Jul 19, 2017

I followed https://github.com/Icinga/puppet-icinga2/blob/master/TESTING.md and unit tests are failing for master.

Expected Behavior

Running rake parallel_spec should finish successfully.

Current Behavior

Fails. A lot of the following messages are shown:

No facts were found in the FacterDB for: [{:facterversion=>"/\\A2\\.5\\./", :operatingsystem=>"Windows", :operatingsystemrelease=>"/^Server/", :hardwaremodel=>"x64"}, {:facterversion=>"/\\A2\\.5\\./", :operatingsystem=>"Windows", :operatingsystemrelease=>"/^Server/", :hardwaremodel=>"x64"}, {:facterversion=>"/\\A2\\.5\\./", :operatingsystem=>"CentOS", :operatingsystemrelease=>"/^6/", :hardwaremodel=>"x86_64"}, {:facterversion=>"/\\A2\\.5\\./", :operatingsystem=>"CentOS", :operatingsystemrelease=>"/^7/", :hardwaremodel=>"x86_64"}, {:facterversion=>"/\\A2\\.5\\./", :operatingsystem=>"RedHat", :operatingsystemrelease=>"/^6/", :hardwaremodel=>"x86_64"}, {:facterversion=>"/\\A2\\.5\\./", :operatingsystem=>"RedHat", :operatingsystemrelease=>"/^7/", :hardwaremodel=>"x86_64"}, {:facterversion=>"/\\A2\\.5\\./", :operatingsystem=>"OracleLinux", :operatingsystemrelease=>"/^7/", :hardwaremodel=>"x86_64"}, {:facterversion=>"/\\A2\\.5\\./", :operatingsystem=>"Debian", :operatingsystemrelease=>"/^7/", :hardwaremodel=>"x86_64"}, {:facterversion=>"/\\A2\\.5\\./", :operatingsystem=>"Debian", :operatingsystemrelease=>"/^8/", :hardwaremodel=>"x86_64"}, {:facterversion=>"/\\A2\\.5\\./", :operatingsystem=>"Ubuntu", :operatingsystemrelease=>"/^14.04/", :hardwaremodel=>"x86_64"}, {:facterversion=>"/\\A2\\.5\\./", :operatingsystem=>"Ubuntu", :operatingsystemrelease=>"/^16.04/", :hardwaremodel=>"x86_64"}, {:facterversion=>"/\\A2\\.5\\./", :operatingsystem=>"SLES", :operatingsystemrelease=>"/^12/", :hardwaremodel=>"x86_64"}, {:facterversion=>"/\\A2\\.5\\./", :operatingsystem=>"FreeBSD", :operatingsystemrelease=>"/^11/", :hardwaremodel=>"amd64"}, {:facterversion=>"/\\A2\\.5\\./", :operatingsystem=>"FreeBSD", :operatingsystemrelease=>"/^10/", :hardwaremodel=>"amd64"}]

rake spec end output:

  1) icinga2::feature::api Windows 2012 R2 with ensure => present should contain Icinga2::Feature[api] with ensure => "present"
     Failure/Error: require 'win32/registry'

     Puppet::PreformattedError:
       Evaluation Error: Error while evaluating a Resource Statement, Could not autoload puppet/type/package: Could not autoload puppet/provider/package/chocolatey: cannot load such file -- win32/registry at /home/mbaur/Sources/puppet-icinga2/spec/fixtures/modules/icinga2/manifests/install.pp:32:5 on node mbaur-gitdevelopment.restvlan4.syseleven
...
Stacktrace
...

  2) icinga2::feature::gelf Windows 2012 R2 icinga2_puppet_hostcert fact should match /\/ssl\/certs\/.*.pem/
     Failure/Error: it { expect(Facter.fact(:icinga2_puppet_hostcert).value).to match(/\/ssl\/certs\/.*.pem/) }

       expected "C:\\Program Files\\Puppet Labs\\Puppet\\var\\lib\\puppet\\ssl\\certs\\host.example.org.pem" to match /\/ssl\/certs\/.*.pem/
       Diff:
       @@ -1,2 +1,2 @@
       -/\/ssl\/certs\/.*.pem/
       +"C:\\Program Files\\Puppet Labs\\Puppet\\var\\lib\\puppet\\ssl\\certs\\host.example.org.pem"

     # ./spec/unit/facter/util/fact_icinga2_puppet_hostcert_spec.rb:35:in `block (3 levels) in <top (required)>'

  3) icinga2::feature::gelf Windows 2012 R2 icinga2_puppet_hostprivkey fact should match /\/ssl\/private_keys\/.*.pem/
     Failure/Error: it { expect(Facter.fact(:icinga2_puppet_hostprivkey).value).to match(/\/ssl\/private_keys\/.*.pem/) }

       expected "C:\\Program Files\\Puppet Labs\\Puppet\\var\\lib\\puppet\\ssl\\private_keys\\host.example.org.pem" to match /\/ssl\/private_keys\/.*.pem/
       Diff:
       @@ -1,2 +1,2 @@
       -/\/ssl\/private_keys\/.*.pem/
       +"C:\\Program Files\\Puppet Labs\\Puppet\\var\\lib\\puppet\\ssl\\private_keys\\host.example.org.pem"

     # ./spec/unit/facter/util/fact_icinga2_puppet_hostprivkey_spec.rb:35:in `block (3 levels) in <top (required)>'

  4) icinga2::feature::gelf Windows 2012 R2 icinga2_puppet_localcacert fact should match /\/ssl\/certs\/.*.pem/
     Failure/Error: it { expect(Facter.fact(:icinga2_puppet_localcacert).value).to match(/\/ssl\/certs\/.*.pem/) }

       expected "C:\\Program Files\\Puppet Labs\\Puppet\\var\\lib\\puppet\\ssl\\certs\\ca.pem" to match /\/ssl\/certs\/.*.pem/
       Diff:
       @@ -1,2 +1,2 @@
       -/\/ssl\/certs\/.*.pem/
       +"C:\\Program Files\\Puppet Labs\\Puppet\\var\\lib\\puppet\\ssl\\certs\\ca.pem"

     # ./spec/unit/facter/util/fact_icinga2_puppet_localcacert_spec.rb:35:in `block (3 levels) in <top (required)>'

Finished in 5 minutes 52 seconds (files took 52.8 seconds to load)
671 examples, 4 failures

Failed examples:

rspec ./spec/classes/api_spec.rb:330 # icinga2::feature::api Windows 2012 R2 with ensure => present should contain Icinga2::Feature[api] with ensure => "present"
rspec ./spec/unit/facter/util/fact_icinga2_puppet_hostcert_spec.rb:35 # icinga2::feature::gelf Windows 2012 R2 icinga2_puppet_hostcert fact should match /\/ssl\/certs\/.*.pem/
rspec ./spec/unit/facter/util/fact_icinga2_puppet_hostprivkey_spec.rb:35 # icinga2::feature::gelf Windows 2012 R2 icinga2_puppet_hostprivkey fact should match /\/ssl\/private_keys\/.*.pem/
rspec ./spec/unit/facter/util/fact_icinga2_puppet_localcacert_spec.rb:35 # icinga2::feature::gelf Windows 2012 R2 icinga2_puppet_localcacert fact should match /\/ssl\/certs\/.*.pem/

/home/mbaur/.rvm/rubies/ruby-2.3.3/bin/ruby -I/home/mbaur/.rvm/gems/ruby-2.3.3/gems/rspec-core-3.6.0/lib:/home/mbaur/.rvm/gems/ruby-2.3.3/gems/rspec-support-3.6.0/lib /home/mbaur/.rvm/gems/ruby-2.3.3/gems/rspec-core-3.6.0/exe/rspec --pattern spec/\{aliases,classes,defines,unit,functions,hosts,integration,type_aliases,types\}/\*\*/\*_spec.rb --color failed

Possible Solution

?

Steps to Reproduce (for bugs)

Follow the installation procedure descibed in https://github.com/Icinga/puppet-icinga2/blob/master/TESTING.md on a fresh Ubuntu 16.04 installation with rvm 1.29.2 and Ruby 2.3.3

Context

I would like to contribute to this module but i can't a a lot of tests are failing if I run them against your master. Strange thing is, they seem to work (at least partly) at Travis, see #334

Your Environment

mbaur@mbaur-gitdevelopment:~/Sources/puppet-icinga2$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 16.04.2 LTS
Release:	16.04
Codename:	xenial
mbaur@mbaur-gitdevelopment:~/Sources/puppet-icinga2$ ruby --version
ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux]
mbaur@mbaur-gitdevelopment:~/Sources/puppet-icinga2$ rvm --version
rvm 1.29.2 (latest) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io/]
mbaur@mbaur-gitdevelopment:~/Sources/puppet-icinga2$ gem --version
2.6.12
mbaur@mbaur-gitdevelopment:~/Sources/puppet-icinga2$ bundle --version
Bundler version 1.15.2
mbaur@mbaur-gitdevelopment:~/Sources/puppet-icinga2$ puppet --version
4.10.4
@baurmatt
Copy link
Contributor Author

Ah, this is related to voxpupuli/facterdb#44. Should i open a PR which fixes the Gemfile by using '< 2.5.0' for facter?

@lbetz lbetz added the bug label Jul 31, 2017
@lbetz lbetz added this to the v1.3.1 milestone Jul 31, 2017
@lbetz
Copy link
Contributor

lbetz commented Aug 2, 2017

Update to facterdb 0.3.12, facter 2.5 supported is added.

@lbetz lbetz closed this as completed Aug 2, 2017
@lbetz lbetz added question and removed bug labels Aug 2, 2017
@lbetz lbetz removed this from the v1.3.1 milestone Aug 2, 2017
@lbetz lbetz added bug and removed question labels Aug 2, 2017
@lbetz lbetz self-assigned this Aug 2, 2017
@lbetz lbetz added this to the v1.3.1 milestone Aug 2, 2017
@lbetz lbetz changed the title Unit tests broken? Unit tests broken for facter 2.5 Aug 2, 2017
lbetz added a commit that referenced this issue Aug 2, 2017
lbetz added a commit that referenced this issue Aug 2, 2017
…2.5-338

fix #338 update facterdb dependency to 0.3.12
@baurmatt
Copy link
Contributor Author

baurmatt commented Aug 2, 2017

Thanks! :)

n00by pushed a commit to n00by/puppet-icinga2 that referenced this issue Apr 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants