Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ColeHiggins2
Copy link
Member

No description provided.

@ColeHiggins2 ColeHiggins2 added CherryPick PR needs CherryPick to previous branches AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing Stream Introduced in or relating directly to Satellite Stream/Master 6.15.z Introduced in or relating directly to Satellite 6.15 6.16.z Introduced in or relating directly to Satellite 6.16 labels Nov 13, 2024
@ColeHiggins2 ColeHiggins2 self-assigned this Nov 13, 2024
@ColeHiggins2 ColeHiggins2 requested a review from a team as a code owner November 13, 2024 20:33
Copy link
Member

@chris1984 chris1984 left a 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

@chris1984 chris1984 requested a review from a team November 13, 2024 21:15
module_target_sat,
):
"""Verify that triggering the InsightsScheduledSync job in Satellite succeeds with no errors
:id: 59f66062-2865-4cca-82bb-8d0501fd40f1
Copy link
Contributor

@LadislavVasina1 LadislavVasina1 Nov 14, 2024

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

Suggested change
:id: 59f66062-2865-4cca-82bb-8d0501fd40f1
:id: 59f66062-2865-4cca-82bb-8d0501fd40f1

Otherwise seems good to me!

Copy link
Contributor

@LadislavVasina1 LadislavVasina1 left a 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.

@LadislavVasina1
Copy link
Contributor

And also can we run some PRT on this please?

Copy link
Contributor

@vsedmik vsedmik left a 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
Copy link
Contributor

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.15.z Introduced in or relating directly to Satellite 6.15 6.16.z Introduced in or relating directly to Satellite 6.16 AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing CherryPick PR needs CherryPick to previous branches Stream Introduced in or relating directly to Satellite Stream/Master
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants