-
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
[CC Automation] Test for Scheduled insights sync job #16913
[CC Automation] Test for Scheduled insights sync job #16913
Conversation
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.
Looks fine to me, thanks for the test case
module_target_sat, | ||
): | ||
"""Verify that triggering the InsightsScheduledSync job in Satellite succeeds with no errors | ||
:id: 59f66062-2865-4cca-82bb-8d0501fd40f1 |
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.
@ColeHiggins2 add a blank line here so that the sphinx is satisfied, you can check it locally using make test-docstrings
:id: 59f66062-2865-4cca-82bb-8d0501fd40f1 | |
:id: 59f66062-2865-4cca-82bb-8d0501fd40f1 |
Otherwise seems good to me!
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.
Left one comment regarding docstring formating, otherwise looks good.
And also can we run some PRT on this please? |
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.
Proposed a small change for better readability. Also please kick on the PRT so we know how it works in CI.
task_output = module_target_sat.api.ForemanTask().search( | ||
query={'search': f'id = {inventory_sync["task"]["id"]}'} | ||
) | ||
assert task_output[0].output['host_statuses']['sync'] == 2 |
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.
@ColeHiggins2 Could we define/name some constant for this so we know what it means?
Maybe in robottelo/constants/__init__.py
something like
INSIGHT_SYNC_STATUS = Box(OK = 2, FAIL = 3, UNKNOWN = 42)
and use it globally? (I've seen it at more places already)
assert task_output[0].output['host_statuses']['sync'] == INSIGHT_SYNC_STATUS.OK
I think @toledo would know the valid statuses, he could help here.
(I used Box
coz I like .
syntax, but could be dict
or anything.)
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.
The status here is not "OK, Fail, and Unknown". Its the count of how many hosts synced successfully
371e4e2
to
15a235b
Compare
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.
Looks good! only the RHEL10 case failed.
We just need the new repo added for insights client setup- #17063
15a235b
to
8ecbbd8
Compare
* test for scheduling insights sync * pre-commit * addressing comments * update docstring (cherry picked from commit dd4c0ee)
* test for scheduling insights sync * pre-commit * addressing comments * update docstring (cherry picked from commit dd4c0ee)
No description provided.