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

Fix legacy errata upgrade scenario tests #17183

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vsedmik
Copy link
Contributor

@vsedmik vsedmik commented Dec 16, 2024

Problem Statement

  1. We have seen several post_upgrade failures for "rhel_contenthost-parametrized" upgrade scenario tests where the pre-data could not be fetched from the scenario_entities file:
failed on setup with "Failed: Invalid test parameter: rhel7. Test data not found."

The reason is that the pre-upgrade test names are now suffixed with -ipv4 so the scenario_entities hold items like this:

{"tests/upgrades/test_repository.py::TestSimpleContentAccessOnly::test_pre_simple_content_access_only[rhel7-ipv4]": {...}}
  1. [POC] New-Style Upgrade Tests #14111 extended the ContentInfo.publish_content_view() method of with the name parameter without updating tests in the legacy upgrade scenarios, so now they cry:
TypeError: ContentInfo.publish_content_view() missing 1 required positional argument: 'name'

Solution

  1. Pick the test names from scenario_entities including their suffix.
  2. Make the name parameter optional.

Local run results

(venv) [vsedmik@fedora robottelo]$ pytest tests/upgrades/test_errata.py -m pre_upgrade -k test_pre_scenario_generate_errata_for_client
========================================================== test session starts =========================================================
...
collected 6 items / 3 deselected / 3 selected

tests/upgrades/test_errata.py ...                                                                                                [100%]

====================================== 3 passed, 3 deselected, 283 warnings in 1859.47s (0:30:59) ======================================



(venv) [vsedmik@fedora robottelo]$ pytest tests/upgrades/test_errata.py -m post_upgrade -k test_post_scenario_errata_count_installation
========================================================== test session starts =========================================================
...
collected 6 items / 3 deselected / 3 selected

tests/upgrades/test_errata.py ...                                                                                                [100%]

======================================= 3 passed, 3 deselected, 99 warnings in 353.67s (0:05:53) =======================================

@vsedmik vsedmik added CherryPick PR needs CherryPick to previous branches 6.14.z Introduced in or relating directly to Satellite 6.14 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 Dec 16, 2024
@vsedmik vsedmik self-assigned this Dec 16, 2024
@vsedmik vsedmik requested review from a team as code owners December 16, 2024 18:34
@vsedmik
Copy link
Contributor Author

vsedmik commented Dec 17, 2024

^ Fixed make docs to make CI/CQ happy.

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.

nice! thank you for this upgrade fix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.14.z Introduced in or relating directly to Satellite 6.14 6.15.z Introduced in or relating directly to Satellite 6.15 6.16.z Introduced in or relating directly to Satellite 6.16 CherryPick PR needs CherryPick to previous branches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants