Skip to content

(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

Conversation

Iristyle
Copy link
Contributor

  • 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.

 - 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
Copy link
Contributor

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).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like somewhere in

RSpec.configure do |config|

Copy link
Contributor

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 ;)

Copy link
Contributor Author

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.

Copy link
Contributor Author

@Iristyle Iristyle Aug 23, 2016

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

Copy link
Contributor Author

@Iristyle Iristyle Aug 24, 2016

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

@glennsarti
Copy link
Contributor

+1 for merge from me. @ferventcoder you good for merge?

@glennsarti glennsarti merged commit 82c18a0 into puppetlabs:stable Aug 23, 2016
@Iristyle Iristyle deleted the maint/stable/PUP-4.6-fixes-transaction-persistence branch August 23, 2016 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants