Skip to content

(#16239) mock of facter :operatingsystem pending#1072

Merged
slippycheeze merged 2 commits intopuppetlabs:3.xfrom
vrthra:ticket/3.x/15547_fix_mock
Sep 7, 2012
Merged

(#16239) mock of facter :operatingsystem pending#1072
slippycheeze merged 2 commits intopuppetlabs:3.xfrom
vrthra:ticket/3.x/15547_fix_mock

Conversation

@vrthra
Copy link
Contributor

@vrthra vrthra commented Aug 25, 2012

Previously, the pending for solaris was specified incorrectly resulting in the test being pending in all platforms.
This checkin removes the pending state, and ensures that the test runs on all platforms.

@joshcooper
Copy link
Contributor

Since we stub Facter.stubs(:value).with(:operatingsystem).returns('Darwin') in the top-level before each block, we get an unexpected invocation when trying to return the real osfamily fact

 40) mount provider (integration) When initially mounted When there is an initial fstab entry When setting ensure => absent When setting options => journaled should leave the system in the unmounted state, without data in /etc/fstab
     Failure/Error: catalog.apply
     Mocha::ExpectationError:
       unexpected invocation: Facter.value(:osfamily)
       satisfied expectations:
       - allowed any number of times, not yet invoked: Signal.trap(any_parameters)
       - allowed any number of times, invoked 3 times: Puppet::Type::Mount::ProviderParsed.default_target(any_parameters)
       - allowed any number of times, invoked once: Facter.value(:operatingsystem)
       - allowed any number of times, not yet invoked: #.backup(any_parameters)
       - expected never, not yet invoked: #.err(any_parameters)
     # ./lib/puppet/provider/mount/parsed.rb:91:in `mountinstances'
     # ./lib/puppet/provider/mount/parsed.rb:77:in `prefetch'
     # ./lib/puppet/transaction.rb:284:in `prefetch'
     # ./lib/puppet/transaction.rb:272:in `prefetch_if_necessary'
     # ./lib/puppet/transaction.rb:376:in `traverse'
     # ./lib/puppet/transaction.rb:99:in `evaluate'
     # ./lib/puppet/resource/catalog.rb:144:in `apply'
     # ./spec/integration/provider/mount_spec.rb:79:in `run_in_catalog'
     # ./spec/integration/provider/mount_spec.rb:112

@vrthra
Copy link
Contributor Author

vrthra commented Aug 28, 2012

@joshcooper updated the check by saving family.

@slippycheeze
Copy link
Contributor

So, looking at the ticket I see that it is closed; @vrthra, is this still applicable?

@vrthra
Copy link
Contributor Author

vrthra commented Aug 31, 2012

@daniel-pittman yes it is still applicable, this file was missed in the original checkin. Should I open another bug? or can I push it as maint?

@slippycheeze
Copy link
Contributor

You should probably open a new bug covering whatever part of the original issue is still unresolved, and link the two together. That way people don't lose track of all the parts of solving the problem.

Previously, the pending for solaris was specified incorrectly resulting in the test being pending in all platforms.
This checkin corrects this mistake. Since Facter[:osfamily] is stubbed before each tests, we save the family value before
starting and use it to compare.
Previously presence of directories of names 'my test file' caused the test to fail
This patch stubs the FileTest.directory? to ensure the tests pass.
@vrthra
Copy link
Contributor Author

vrthra commented Sep 5, 2012

@daniel-pittman updated with bug #16239

slippycheeze added a commit that referenced this pull request Sep 7, 2012
(#16239) mock of facter :operatingsystem pending
@slippycheeze slippycheeze merged commit 1548b2c into puppetlabs:3.x Sep 7, 2012
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