-
Notifications
You must be signed in to change notification settings - Fork 79
(maint) Fix test failures for Puppet 4.6 #135
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
(maint) Fix test failures for Puppet 4.6 #135
Conversation
- Some internal changes to transaction behavior that are part of Puppet 4.6, have induced a new problem with the existing tests that invoked the compiler. Transactionstore.yaml files are now produced when a transaction is processed, for the sake of identifying changes as part of the `corrective changes` feature. Without the Puppet[:statedir] explicitly set, compiling a catalog and executing a transaction will attempt to write a YAML file to c:\dev\null. Instead, explicitly set the path to allow for a real file to be written as part of the transaction.
|
||
after :each do | ||
FileUtils.rm_rf(tmpdir) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems better to change as part of the spec helper (and then later as puppetlabs_spec_helper).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like somewhere in
puppetlabs-powershell/spec/spec_helper.rb
Line 24 in f8ef8bb
RSpec.configure do |config| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries, this one is simpler as there is one place to adjust. I was just thinking for consistency if we add it in several places when we get repos that have more than one test file ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I could have moved it further out... but... there's also the matter of this only being applicable to a couple of tests. And those tests are a bit outside the norm of our regular unit tests given they use Puppet as a library to compile manifests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could also change this to vardir
from statedir
Nope, still need to create directories all the way out to /state
if we set vardir
- so this is indeed simpler.
Looks like we might want to think about changing the /dev/null
behavior from puppetlabs-spec_helper at https://github.com/puppetlabs/puppetlabs_spec_helper/blob/917fd0c45a60539433c50763f7d96eb2c40a3539/lib/puppetlabs_spec_helper/puppet_spec_helper.rb#L74, originally introduced back in 2012 at puppetlabs/puppetlabs_spec_helper@69bf2bc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought, we probably want /dev/null
behavior for the sake of specs (i.e. tests that don't touch disk).
PSH should probably be updated to mock out the transaction store code, which most implementers will not need for the sake of writing tests like this / against puppet apply
+1 for merge from me. @ferventcoder you good for merge? |
Some internal changes to transaction behavior that are part of
Puppet 4.6, have induced a new problem with the existing tests that
invoked the compiler. Transactionstore.yaml files are now
produced when a transaction is processed, for the sake of
identifying changes as part of the
corrective changes
feature.Without the Puppet[:statedir] explicitly set, compiling a catalog
and executing a transaction will attempt to write a YAML file to
c:\dev\null.
Instead, explicitly set the path to allow for a real file to be
written as part of the transaction.