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

Update Platform tests that have hard coded content host versions #14317

Merged
merged 1 commit into from
Apr 3, 2024

Conversation

Griffin-Sullivan
Copy link
Contributor

Problem Statement

PIT isn't running some of Platform's tests because they are hard coded to older rhel versions (7 or 8).

Solution

Update tests to be future-proof and run on whatever the test suite decides (ie: use settings file).

Related Issues

@Griffin-Sullivan Griffin-Sullivan added CherryPick PR needs CherryPick to previous branches AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing 6.13.z Introduced in or relating directly to Satellite 6.13 6.14.z Introduced in or relating directly to Satellite 6.14 6.15.z Introduced in or relating directly to Satellite 6.15 labels Mar 8, 2024
@Griffin-Sullivan Griffin-Sullivan requested review from a team as code owners March 8, 2024 14:41
@Griffin-Sullivan
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/destructive/test_capsule_loadbalancer.py::test_loadbalancer_install_package tests/foreman/maintain/test_upgrade.py::test_negative_pre_upgrade_tuning_profile_check

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 6000
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/destructive/test_capsule_loadbalancer.py::test_loadbalancer_install_package tests/foreman/maintain/test_upgrade.py::test_negative_pre_upgrade_tuning_profile_check --external-logging
Test Result : ============ 2 failed, 172 warnings, 1 error in 3839.20s (1:03:59) =============

@Satellite-QE Satellite-QE added the PRT-Failed Indicates that latest PRT run is failed for the PR label Mar 8, 2024
@Griffin-Sullivan Griffin-Sullivan marked this pull request as draft March 8, 2024 17:39
@Griffin-Sullivan
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/destructive/test_capsule_loadbalancer.py::test_loadbalancer_install_package tests/foreman/maintain/test_upgrade.py::test_negative_pre_upgrade_tuning_profile_check

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 6004
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/destructive/test_capsule_loadbalancer.py::test_loadbalancer_install_package tests/foreman/maintain/test_upgrade.py::test_negative_pre_upgrade_tuning_profile_check --external-logging
Test Result : ============ 2 passed, 163 warnings, 1 error in 3824.93s (1:03:44) =============

@Griffin-Sullivan
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/destructive/test_capsule_loadbalancer.py::test_loadbalancer_install_package tests/foreman/maintain/test_upgrade.py::test_negative_pre_upgrade_tuning_profile_check

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 6005
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/destructive/test_capsule_loadbalancer.py::test_loadbalancer_install_package tests/foreman/maintain/test_upgrade.py::test_negative_pre_upgrade_tuning_profile_check --external-logging
Test Result : ============ 2 passed, 167 warnings, 1 error in 5645.72s (1:34:05) =============

@Griffin-Sullivan
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/destructive/test_capsule_loadbalancer.py::test_loadbalancer_install_package tests/foreman/maintain/test_upgrade.py::test_negative_pre_upgrade_tuning_profile_check

2 similar comments
@devendra104
Copy link
Member

trigger: test-robottelo
pytest: tests/foreman/destructive/test_capsule_loadbalancer.py::test_loadbalancer_install_package tests/foreman/maintain/test_upgrade.py::test_negative_pre_upgrade_tuning_profile_check

@Griffin-Sullivan
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/destructive/test_capsule_loadbalancer.py::test_loadbalancer_install_package tests/foreman/maintain/test_upgrade.py::test_negative_pre_upgrade_tuning_profile_check

@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 6057
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/destructive/test_capsule_loadbalancer.py::test_loadbalancer_install_package tests/foreman/maintain/test_upgrade.py::test_negative_pre_upgrade_tuning_profile_check --external-logging
Test Result : ================= 3 passed, 152 warnings in 6932.54s (1:55:32) =================

@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 Mar 13, 2024
@Griffin-Sullivan Griffin-Sullivan marked this pull request as ready for review March 14, 2024 15:22
pytest_fixtures/core/contenthosts.py Outdated Show resolved Hide resolved
deploy_args['deploy_rhel_version'] = deploy_args.get('deploy_rhel_version', '8')
# if 'deploy_rhel_version' is not set, let's default to what's in server.yaml
deploy_args['deploy_rhel_version'] = deploy_args.get(
'deploy_rhel_version', settings.server.version.rhel_version
Copy link
Contributor

@lhellebr lhellebr Mar 19, 2024

Choose a reason for hiding this comment

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

Why server version? Why not version from conf/content_host.yaml? Is it because it's for PIT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I guess this is not obvious from the description but this host becomes a Satellite so I opt to use the Satellite os version from the settings file and not content host.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since this custom_host fixture can be whatever you want let's do your change here and default to content_host.yaml and in my test we'll keep the server.yaml

@@ -638,7 +638,7 @@ def setup_org_for_a_custom_repo(self, options=None):
lce_promoted = cv_info['lifecycle-environments']
# Promote version to next env
try:
if env_id not in [int(lce['id']) for lce in lce_promoted]:
if (env_id not in [int(lce['id']) for lce in lce_promoted]) or multi_repo:
Copy link
Contributor

Choose a reason for hiding this comment

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

Explain in # comment please

Copy link
Collaborator

Choose a reason for hiding this comment

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

It's not clear, what is multi_repo arg here could you elaborate? and when multi_repo is True, then shouldn't we check that first then the other check?

Copy link
Member

Choose a reason for hiding this comment

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

Can someone from the Phoenix-content group chime in and provide feedback on it?
@vsedmik @ColeHiggins2 @sambible @vijaysawant

Copy link
Contributor

Choose a reason for hiding this comment

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

Eh, it seems that @Griffin-Sullivan is trying to bypass @vijaysawant's bypass.

Looking at the first bypass PR, my guess is that it was trying to resolve the CVV Sorting Issue, which was later fixed on line 638.

Anyway, reading the docstring I don't think this helper was meant to be called in a loop, not for adding repos. It was for wrapping a repo into a product and shipping it via CV and AK.
If we need to create more custom repos in one custom product, we could extend the helper and pass the repo urls as a list and add them inside the helper.

Also, wouldn't it be easier for you @Griffin-Sullivan use this instead?

def enable_sync_redhat_repo(self, rh_repo, org_id, timeout=1500):

I mean baseos and appstream are not custom repos, you could sync them as RH repos (just use module_sca_manifest_org instead of module_org) and ship them through the CV/LCE/AK used in your content_for_client fixture?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was just trying to get around the issue that I explain in the comment. I was trying to make as minimal changes as possible for the test since I'm just trying to convert to using newer rhel versions. I guess in this case I can revert the change and use a different helper like enable_sync_redhat_repo

}
)
rhel_ver = settings.content_host.default_rhel_version
baseos = eval(f'settings.repos.RHEL{rhel_ver}_OS.baseos')
Copy link
Contributor

Choose a reason for hiding this comment

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

How about versions < 8 which don't have baseos and upstream?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My thought process was to keep this simple and not support RHEL 7 but I guess a good question would be how long do we need to support rhel 7? Especially in this one scenario that affects only this test.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's up to you, I just pointed it out.

{'deploy_rhel_version': '8', 'deploy_flavor': 'satqe-ssd.disk.xxxl'},
{'deploy_rhel_version': '8', 'deploy_flavor': 'satqe-ssd.standard.std'},
{
'deploy_rhel_version': settings.server.version.rhel_version,
Copy link
Contributor

Choose a reason for hiding this comment

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

Again, consider using conf/content_host.yaml here and in the following code (I'm not commenting on everything separately)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See above

@Griffin-Sullivan Griffin-Sullivan force-pushed the platform-hosts branch 2 times, most recently from 89b43c9 to dd1a20b Compare March 19, 2024 15:14
@Griffin-Sullivan
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/destructive/test_capsule_loadbalancer.py::test_loadbalancer_install_package tests/foreman/maintain/test_upgrade.py::test_negative_pre_upgrade_tuning_profile_check

@Satellite-QE Satellite-QE removed the PRT-Passed Indicates that latest PRT run is passed for the PR label Mar 25, 2024
@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 6187
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/destructive/test_capsule_loadbalancer.py::test_loadbalancer_install_package tests/foreman/maintain/test_upgrade.py::test_negative_pre_upgrade_tuning_profile_check --external-logging
Test Result : ============ 2 passed, 149 warnings, 1 error in 4646.23s (1:17:26) =============

@Satellite-QE Satellite-QE added the PRT-Failed Indicates that latest PRT run is failed for the PR label Mar 25, 2024
@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 6189
Build Status: UNSTABLE
PRT Comment: pytest tests/foreman/destructive/test_capsule_loadbalancer.py::test_loadbalancer_install_package tests/foreman/maintain/test_upgrade.py::test_negative_pre_upgrade_tuning_profile_check --external-logging
Test Result : ============ 2 passed, 150 warnings, 1 error in 4638.46s (1:17:18) =============

@Griffin-Sullivan Griffin-Sullivan marked this pull request as draft March 25, 2024 17:18
@Griffin-Sullivan
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/destructive/test_capsule_loadbalancer.py::test_loadbalancer_install_package

@Satellite-QE Satellite-QE removed the PRT-Failed Indicates that latest PRT run is failed for the PR label Mar 27, 2024
@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 6225
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/destructive/test_capsule_loadbalancer.py::test_loadbalancer_install_package --external-logging
Test Result : ================== 1 passed, 5 warnings in 5498.90s (1:31:38) ==================

@Satellite-QE Satellite-QE added the PRT-Passed Indicates that latest PRT run is passed for the PR label Mar 27, 2024
@Griffin-Sullivan Griffin-Sullivan marked this pull request as ready for review March 27, 2024 17:38
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 final non-blocking nitpick, otherwise looks pretty good! 👍

Comment on lines 123 to 124
haproxy.install_katello_ca(module_target_sat)
haproxy.register_contenthost(module_org.label, haproxy_ak.name)
Copy link
Contributor

Choose a reason for hiding this comment

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

I would just recommend to use global registration

Suggested change
haproxy.install_katello_ca(module_target_sat)
haproxy.register_contenthost(module_org.label, haproxy_ak.name)
haproxy.register(module_org, None, haproxy_ak.name, module_target_sat)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd say this is outside of the scope of the PR, but if other reviewers agree to change it now I'll update it.

Comment on lines +136 to +138
custom_host.execute(
f'dnf -y module enable satellite:el{rhel_major} && dnf -y install satellite'
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we add a check here and split this module enable part as this is only for EL8?

Copy link
Contributor

@lhellebr lhellebr left a comment

Choose a reason for hiding this comment

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

My comments have been addressed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.13.z Introduced in or relating directly to Satellite 6.13 6.14.z Introduced in or relating directly to Satellite 6.14 6.15.z Introduced in or relating directly to Satellite 6.15 AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing CherryPick PR needs CherryPick to previous branches PRT-Passed Indicates that latest PRT run is passed for the PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants