-
Notifications
You must be signed in to change notification settings - Fork 115
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
Add test case to trigger the reclaim_space task #14397
Conversation
trigger: test-robottelo |
PRT Result
|
trigger: test-robottelo |
"trigger": "test-robottelo" |
PRT Result
|
trigger: test-robottelo |
PRT Result
|
Okay so the first PRT fail was due to |
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.
nice work!
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.
co-reviewed with @jameerpathan111.
The intention of the test is good, but I would choose different steps to achieve the same.
trigger: test-robottelo |
PRT Result
|
PRT Result
|
trigger: test-robottelo |
PRT Result
|
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.
Nice work, @vsedmik!
There is only one blocking comment - verify_ssl
should be parametrized by settings.
robottelo/hosts.py
Outdated
@property | ||
def apidoc(self): | ||
"""Provide Satellite's apidoc via apypie""" | ||
if not self._apidoc: | ||
self._apidoc = apypie.Api( | ||
uri=self.url, | ||
username=settings.server.admin_username, | ||
password=settings.server.admin_password, | ||
api_version=2, | ||
verify_ssl=False, | ||
).apidoc | ||
return self._apidoc |
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.
@JacobCallahan Do you see any benefit in making it a @cached_property
instead of the current design?
trigger: test-robottelo |
PRT Result
|
), 'Unexpected task triggered' | ||
assert 'success' in task['result'], 'Reclaim task did not succeed' | ||
|
||
# Check the apidoc references the correct endpoint |
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.
I like the test up to this line, I know the apidoc check responds to the bz, but I'm not convinced it really makes sense to check the apidoc for one specific endpoint. I mean, how likely it is that the same problem reappears at the same endpoint? If it re-appears on a different one we won't catch it anyway. Maybe this would warrant a more general discussion about how (and if) we want to tackle apidoc issues like this one. My hunch is that this should be a case for upstream unit tests.
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.
Yup. The primary goal was to add some coverage for reclaim_space
functionality and the following lines were added just for the case when some reviewer comes and says "but that BZ talks about wrong apidoc, where is it checked".
We can remove it after some generic test for entire apidoc is added? Which would be probably handled by the team owning the API
component.
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.
ACK, changes are fine by me. I will leave the merge up to @pondrejk if they get to a conclusion in the philosophical debate about customer case automation.
Should this verify some space has actually been reclaimed? |
Related: #14425 |
Replied here already #14397 (comment) I can imagine two scenarios where this is tested
|
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.
talked to @vsedmik offline, we agreed the best way forward atm is to merge it as is
* Add test case to trigger the reclaim_space task * Use apypie for apidoc parsing * Address improvement suggestions, rebase (cherry picked from commit ac4b0cf)
Add test case to trigger the reclaim_space task (#14397) * Add test case to trigger the reclaim_space task * Use apypie for apidoc parsing * Address improvement suggestions, rebase (cherry picked from commit ac4b0cf) Co-authored-by: vsedmik <[email protected]>
* Add test case to trigger the reclaim_space task * Use apypie for apidoc parsing * Address improvement suggestions, rebase
Problem Statement
A test case (and nailgun support) to trigger the Reclaim space task was missing. Also a BZ complained about wrong endpoint being referenced in apidoc.
Solution
This PR adds one.
PRT test Cases example
trigger: test-robottelo
pytest: tests/foreman/api/test_capsulecontent.py -k 'reclaim_space'
nailgun: 1111