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
ipatests: add missing automember-cli tests #6718
Conversation
d693ab5
to
fe9b292
Compare
c86cc61
to
1331a0a
Compare
badregextype_regex="qa[0-9]+.example.com") | ||
with raises_exact(errors.NotFound( | ||
reason=u'no such option: --badregextype-regex')): | ||
command() |
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 class is testing CLI parsing, not the automember plugin itself. It's fine in a way to exercise the parsing code but it isn't specific to this.
You can find the test failures here (It's little bit tricky to navigate in Azure) |
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.
Please see the in-line comments. The main problem is with incorrect Error
type and missing/exists requirement
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.
Hi @mbhalodi
to make the code easier to read, I would structure it with fewer classes. For instance, use a single class for all the negative tests related to automember-find, use another one for automember-show etc...
Inside each class, add functions to test each parameter (with non existent group, with bad type ...)
fce90f0
to
4501f6c
Compare
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.
Hi @mbhalodi
please find a few inline comments
e26bcb4
to
47ceedc
Compare
To note that, to resolve the Tox issue, Flo made a separate PR #6758. |
The tox failure is being addressed in: #6758 The GATING_upgrade test is unfortunately a bit flaky at times and sometimes requires multiple re-runs for it to pass. I'd wait until is fixed and you rebase on top of that to attempt multiple re-runs because you'd have to do it all again later anyway. |
@mbhalodi PR#6758 has been merged and should fix the tox issue. Please rebase on top of the master branch. |
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.
Hi @mbhalodi
Thanks for the update. Please find my inline comments.
""" Try to find a rule with non-existent group/hostgroup """ | ||
grp = request.getfixturevalue(grp) | ||
automember_grp = request.getfixturevalue(automember_grp) | ||
grp.ensure_missing() |
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.
It should be automember_grp.ensure_missing().
The function can be simplified and use only automember_grp + request parameters (grp is not useful here).
@mbhalodi
and
|
9806ebf
to
15275f6
Compare
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.
Hi @mbhalodi
thanks for the update, we're almost done!
I have a few nitpicks related to the comments but otherwise the code LGTM.
Revisit the bash tests and port the valid tests to upstream. Related: https://pagure.io/freeipa/issue/9332 Signed-off-by: mbhalodi <mbhalodi@redhat.com>
master:
|
This patch is focusing on negative test scenarios of automember-cli.
Related: https://pagure.io/freeipa/issue/9332
Signed-off-by: mbhalodi mbhalodi@redhat.com