-
-
Notifications
You must be signed in to change notification settings - Fork 94
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
OS facts clutter with recent ruby versions in spec tests #518
Comments
Yes, I did it in v2.x as I rework the test. We don't will spent time on that for v1.x I think. |
Hm, ~/puppetcode/modules/icinga2:master±$ rake spec_standalone SPEC=spec/classes/api_spec.rb Deprecation Warnings: puppetlabs_spec_helper: defaults If you need more of the backtrace for any of these deprecations to 1 deprecation warning total Finished in 2 minutes 3.2 seconds (files took 3.51 seconds to load) Works fine on my ruby 2.5.3... |
I have problems running the unit tests on recent ruby versions.
I have an environment with a stable Debian that is able to successfully execute the tests in
api_spec.rb
:And an environment running testing Debian/buster:
On this environment most tests in
api_spec.rb
(and in other test cases) fail.A lot of errors are about wrong file paths. Some errors report paths with 'C:...' for centos and other linux variants.
Steps to reproduce
On both environments execute:
Findings
In
manifests/param.pp
add:Add minimal new test case in
spec/classes/bug_spec.rb
:Execute it with:
Seems like the pre_conditions is run with the same facts for all
on_supported_os.each
loops.Fix/Workaround
It works when i wrap everything inside the
on_supported_os.each
block in an additionalcontext "on #{os}" do
block. That's the way the examples in the rspec-puppet-facts do it.With an additional context block the tests succeed:
Conclusion
I did not find an difference except the ruby version yet and could not find the root cause for this change of behavior.
The text was updated successfully, but these errors were encountered: