Martin Heistermann
2014-Apr-29 13:45 UTC
[Puppet Users] vcsrepo module: is my patch faulty or are the test failures unjustified?
Hi, I have some vcsrepo resources that check out out a revision specified by SHA1 hash. However, on every run 'git fetch' is run to verify that the correct revision is checked out. I think that shouldn't be necessary, so I tried to patch vcsrepo to avoid such fetches in that case: https://github.com/mheistermann/puppetlabs-vcsrepo/commit/68cf48ec624dddfd1cdd034638131829fd2d46fb After this change, several spec tests fail: https://gist.github.com/anonymous/11399436 You can find the source of the failing tests (current HEAD) here: https://github.com/puppetlabs/puppetlabs-vcsrepo/blob/46588aa62d444c5f0a538cccec357a80cd191b93/spec/unit/puppet/provider/vcsrepo/git_spec.rb#L173 The test "checking the revision property when its SHA1 is not different than the current SHA should return the ref", which fits my setup, seems to fails because the changed code does not do some git invocations required by the test, which i believe to be superfluous. If I understand it correctly (I'm new to ruby and rspec), the other failing tests hand the string 'currentsha' to the tested code both as resource revision as well as 'git rev-parse HEAD' output (L176, L178). I think that 'currentsha' would be the correct method return value, with no git invocations except for 'git rev-parse HEAD'. I am not sure if my code actually introduces wrong behavior (how?) or if the tests failures are actually not justified and would be glad about your comments. Thanks in advance! Martin -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/72d53153-fba6-4ff9-9588-d3c134e97c68%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.