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

[Pheonix Subs] Fix AK creation in ui/test_activationkey.py #17290

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

Conversation

ColeHiggins2
Copy link
Member

@ColeHiggins2 ColeHiggins2 commented Jan 9, 2025

Problem Statement

Since 6.17 Activation keys create and update ops need both - CV and LCE, or none of them.
This new reality broke a couple of tests.

Solution

This PR fixes UI tests in activationkey.py

Related Issues

SAT-28577

@ColeHiggins2 ColeHiggins2 added No-CherryPick PR doesnt need CherryPick to previous branches Stream Introduced in or relating directly to Satellite Stream/Master labels Jan 9, 2025
@ColeHiggins2 ColeHiggins2 self-assigned this Jan 9, 2025
@ColeHiggins2 ColeHiggins2 requested a review from a team as a code owner January 9, 2025 20:07
@ColeHiggins2
Copy link
Member Author

trigger: test-robottelo
pytest: tests/foreman/ui/test_activationkey.py -k test_positive_add_host

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 3
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/ui/test_activationkey.py -k test_positive_add_host --external-logging
Test Result : ========== 50 deselected, 63 warnings, 9 errors in 1643.61s (0:27:23) ==========

@Satellite-QE Satellite-QE added the PRT-Failed Indicates that latest PRT run is failed for the PR label Jan 9, 2025
@ColeHiggins2 ColeHiggins2 changed the title [Pheonix Subs] Fix AK creation in test_positive_add_host [Pheonix Subs] Fix AK creation in ui/test_activationkey.py Jan 9, 2025
@ColeHiggins2
Copy link
Member Author

trigger: test-robottelo
pytest: tests/foreman/ui/test_activationkey.py::test_positive_add_host

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 4
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/ui/test_activationkey.py::test_positive_add_host --external-logging
Test Result : ================= 12 warnings, 8 errors in 1189.76s (0:19:49) ==================

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 9807
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/ui/test_activationkey.py -k test_positive_add_host --external-logging
Test Result : ==== 1 failed, 7 passed, 50 deselected, 1477 warnings in 8802.56s (2:26:42) ====

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 9808
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/ui/test_activationkey.py::test_positive_add_host --external-logging
Test Result : ================= 7 passed, 783 warnings in 6377.36s (1:46:17) =================

@Satellite-QE Satellite-QE added PRT-Passed Indicates that latest PRT run is passed for the PR and removed PRT-Failed Indicates that latest PRT run is failed for the PR labels Jan 9, 2025
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.

One proposal, otherwise looks good to me.

@@ -760,6 +791,7 @@ def test_positive_add_docker_repo_cv(session, module_org, module_target_sat):
content_view = module_target_sat.api.ContentView(
composite=False, organization=module_org, repository=[repo]
).create()
sleep(5)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks the test fails with "errors":["Pending tasks detected in repositories of this content view.
because there is the Metadata generate task running in the background after repo creation.

Could you use wait_for_task instead of sleep(5)? Though the sleep works now it may not be enough in future, IMHO we should better wait for the dependant background task before proceeding with publish.

You can do this

Suggested change
sleep(5)
module_target_sat.wait_for_tasks(
search_query='Actions::Katello::Repository::MetadataGenerate'
f' and resource_id = {repo.id}'
' and resource_type = Katello::Repository',
max_tries=6,
search_rate=10,
)

or better, throw it into a fixture together with the repo creation like here, so you don't duplicate code for the other sleep.

Copy link
Contributor

@pondrejk pondrejk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack pending existing comments

Copy link
Contributor

@vijaysawant vijaysawant left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack
Plus one to use of 'wait for metadata generation tasks'.

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.

ACK, pending comments from @vsedmik

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.

ACK, pending vsedmik`s comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
No-CherryPick PR doesnt need CherryPick to previous branches PRT-Passed Indicates that latest PRT run is passed 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