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

Merged
merged 4 commits into from
Dec 4, 2024

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

Copy link
Member Author

@ColeHiggins2 ColeHiggins2 Dec 2, 2024

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

@damoore044
Copy link
Contributor

trigger: test-robottelo
pytest: tests/foreman/api/test_rhcloud_inventory.py::test_rhcloud_scheduled_insights_sync

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 9516
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/api/test_rhcloud_inventory.py::test_rhcloud_scheduled_insights_sync --external-logging
Test Result : ============ 6 passed, 832 warnings, 1 error in 5019.19s (1:23:39) =============

@Satellite-QE Satellite-QE added the PRT-Failed Indicates that latest PRT run is failed for the PR label Dec 3, 2024
Copy link
Contributor

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

@damoore044 damoore044 force-pushed the schedule-insights-sync branch from 15a235b to 8ecbbd8 Compare December 4, 2024 14:35
@damoore044 damoore044 enabled auto-merge (squash) December 4, 2024 14:36
@damoore044 damoore044 merged commit dd4c0ee into SatelliteQE:master Dec 4, 2024
8 checks passed
github-actions bot pushed a commit that referenced this pull request Dec 4, 2024
* test for scheduling insights sync

* pre-commit

* addressing comments

* update docstring

(cherry picked from commit dd4c0ee)
github-actions bot pushed a commit that referenced this pull request Dec 4, 2024
* test for scheduling insights sync

* pre-commit

* addressing comments

* update docstring

(cherry picked from commit dd4c0ee)
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 PRT-Failed Indicates that latest PRT run is failed for the PR Stream Introduced in or relating directly to Satellite Stream/Master
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants