Fix user provider specs - #604
Conversation
Logs of the failing RSpec tests |
|
I believe the failing testcase is due to a mismatch of In Debian we use 2.5.1, which should be the latest release. I couldn't tell which version is used in the CI environment. |
This fixes multiple user provider specs failing with:
NameError:
uninitialized constant Etc::PasswdEntry
which suggests these specs weren't getting much exercise, probably
because the CI environment is lacking the ruby-shadow library which in
turn disables the Puppet feature transparently.
It also updates a couple assertions that were also outdated.
Signed-off-by: Jérôme Charaoui <jerome@riseup.net>
e82e616 to
2cf0d5f
Compare
Signed-off-by: Jérôme Charaoui <jerome@riseup.net>
2cf0d5f to
9223c41
Compare
| @@ -22,7 +22,7 @@ | |||
|
|
|||
| let(:shadow_entry) { | |||
| return unless Puppet.features.libshadow? | |||
There was a problem hiding this comment.
I guess we never executed that test in CI because the ruby-shadow gem is missing and then the return hits?
There was a problem hiding this comment.
(we need to get the gem into our CI)
There was a problem hiding this comment.
Yes I think that's correct. Installing the gem in CI would be well-advised, IMHO.
| let(:shadow_entry) { | ||
| return unless Puppet.features.libshadow? | ||
| entry = Etc::PasswdEntry.new | ||
| entry = Shadow::Passwd::Entry.new |
There was a problem hiding this comment.
Why is this requried? did the API for the ruby-shadow gem change?
There was a problem hiding this comment.
As I mentioned in the OP, Etc::PasswdEntry doesn't exist, so the test crashes right there, but only when ruby-shadow is available in the environment, which is why it wasn't caught earlier.
If you look at dd3df54 it sounds like the intention was to change it to Etc::Passwd not Etc::PasswdEntry (which doesn't seem to have existed, ever) but that doesn't work either, and it was never caught because again, the spec never actually ran in CI...
This fixes multiple user provider specs failing with:
NameError:
uninitialized constant Etc::PasswdEntry
which suggests these specs weren't getting much exercise, probably because the CI environment is lacking the ruby-shadow library which in turn disables the Puppet feature transparently.
It also updates a couple assertions that were also outdated.