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 test_negative_pre_upgrade_tuning_profile_check #12578

Merged

Conversation

jameerpathan111
Copy link
Contributor

Cherry-pick for #12535 😅

Can't provide test results. Tests are marked to be skipped for the stream, as we still don't have upgrade support.

@jameerpathan111 jameerpathan111 added No-CherryPick PR doesnt need CherryPick to previous branches Stream Introduced in or relating directly to Satellite Stream/Master labels Sep 12, 2023
@jameerpathan111 jameerpathan111 self-assigned this Sep 12, 2023
@jameerpathan111 jameerpathan111 requested review from a team as code owners September 12, 2023 07:44
@ogajduse
Copy link
Member

We can not run PRT here since there is no support for 6.14 -> 6.15 upgrades.

tests/foreman/maintain/test_upgrade.py Show resolved Hide resolved
Comment on lines 155 to 144
# Change to correct tuning profile (default or medium)
custom_host.execute(
f'sed -i "s/tuning: development/tuning: {profile}/g" {INSTALLER_CONFIG_FILE}'
)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't we rerun installer after tuning profile in INSTALLER_CONFIG_FILE? I don't think it'll make any sense for pre-upgrade checks to run if we don't run installer?

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 the point of this test is to check whether the pre-upgrade checks catch the discrepancy. The question is, do the checks really use the config file? I'd suppose they do even though it's not specified explicitly. Otherwise, I think this test would fail on the last assert.

Also, this is just a cherrypick.

Copy link
Collaborator

Choose a reason for hiding this comment

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

yeah, but in reality this should be an main PR and cherrypick got merged #12535, and main PR is called cherrypick here, lol :D

Copy link
Contributor Author

@jameerpathan111 jameerpathan111 Sep 14, 2023

Choose a reason for hiding this comment

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

yeah😄, cause I wanted to test the fix, which I can't do with master branch, so I raised it first against 6.14 🤷

Copy link
Contributor Author

@jameerpathan111 jameerpathan111 Sep 14, 2023

Choose a reason for hiding this comment

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

and tbh I don't like the current approach of us doing TFA for 6.14 and raising a fix against master branch and then running into a bunch of the issues that we never faced in automation cause we never ran the test with stream(and then trying to fix it for stream so prt can pass :| ).

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 don't think it's required to run installer, and like Lukas mentioned the assertion would fail.

tests/foreman/maintain/test_upgrade.py Show resolved Hide resolved
Comment on lines 155 to 144
# Change to correct tuning profile (default or medium)
custom_host.execute(
f'sed -i "s/tuning: development/tuning: {profile}/g" {INSTALLER_CONFIG_FILE}'
)
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 the point of this test is to check whether the pre-upgrade checks catch the discrepancy. The question is, do the checks really use the config file? I'd suppose they do even though it's not specified explicitly. Otherwise, I think this test would fail on the last assert.

Also, this is just a cherrypick.

@jameerpathan111
Copy link
Contributor Author

jameerpathan111 commented Sep 15, 2023

trigger: test-robottelo
pytest: tests/foreman/maintain/test_upgrade.py -k test_negative_pre_upgrade_tuning_profile_check
env:
    ROBOTTELO_server__deploy_arguments__deploy_sat_version: '6.14.0'
    ROBOTTELO_server__deploy_arguments__deploy_snap_version: '16.0'
    ROBOTTELO_server__version__release: '6.14.0'

@lpramuk
Copy link
Contributor

lpramuk commented Sep 18, 2023

trigger: test-robottelo
pytest: tests/foreman/maintain/test_upgrade.py -k test_negative_pre_upgrade_tuning_profile_check
env:
    ROBOTTELO_server__deploy_arguments__deploy_sat_version: '6.14.0'
    ROBOTTELO_server__deploy_arguments__deploy_snap_version: '16.0'
    ROBOTTELO_server__version__release: '6.14.0'

Why are you testing against 6.14.0 while you choose not to cherrypick to 6.14.z branch ?
I would be for 6.14.z cherrypick

Green negative test in 6.14.z doesn't mean automatically it does its job right 😉

@lpramuk
Copy link
Contributor

lpramuk commented Sep 18, 2023

trigger: test-robottelo
pytest: tests/foreman/maintain/test_upgrade.py -k test_negative_pre_upgrade_tuning_profile_check

Copy link
Contributor

@lpramuk lpramuk left a comment

Choose a reason for hiding this comment

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

Make your changes complete
You switch over to development profile but you are not removing test parametrization [default,medium and also you have to accommodate all assert for {profile} which is now not parametrized

@@ -146,11 +147,16 @@ def test_negative_pre_upgrade_tuning_profile_check(request, custom_host):
)
custom_host.download_repofile(product='satellite', release=last_y_stream)
custom_host.execute('dnf -y module enable satellite:el8 && dnf -y install satellite')
# Install without system checks to get around installer checks
# Install with development tuning profile to get around installer checks
Copy link
Contributor

Choose a reason for hiding this comment

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

if you are changing this test to use development profile the you should also handle tests parametrization ids=['default', 'medium'],

and all asserts for {profile}

Copy link
Contributor

Choose a reason for hiding this comment

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

Funny part is green PRT for this NEGATIVE test - failing on something else :D

Copy link
Contributor

Choose a reason for hiding this comment

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

We are only using the development profile to get around installer checks for system requirements like RAM and CPU cores. We have to do this in >= 6.14 because --disable-system-checks was removed. This test is still designed to make sure the default and medium profiles enforce their requirements upon an upgrade check.

@lpramuk lpramuk requested a review from ogajduse September 19, 2023 11:28
@jameerpathan111
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/maintain/test_upgrade.py -k test_negative_pre_upgrade_tuning_profile_check
env:
    ROBOTTELO_server__deploy_arguments__deploy_sat_version: '6.14.0'
    ROBOTTELO_server__deploy_arguments__deploy_snap_version: '16.0'
    ROBOTTELO_server__version__release: '6.14.0'

Why are you testing against 6.14.0 while you choose not to cherrypick to 6.14.z branch ? I would be for 6.14.z cherrypick

Green negative test in 6.14.z doesn't mean automatically it does its job right 😉

Because I can't test it with stream as it doesn't have upgrade support and because Gaurav wanted to see how the test would do with the changes he suggested. :D

@Griffin-Sullivan
Copy link
Contributor

We have the upgrade path in stream now so we can remove the skip and try on stream if you'd like

@Griffin-Sullivan
Copy link
Contributor

trigger: test-robottelo
pytest: tests/foreman/maintain/test_upgrade.py -k test_negative_pre_upgrade_tuning_profile_check

@Griffin-Sullivan Griffin-Sullivan force-pushed the fix_fm_upgrade_615 branch 2 times, most recently from 7d05407 to 953221e Compare October 27, 2023 18:58
@Griffin-Sullivan
Copy link
Contributor

The failure here is due to a bug that @ehelms is working on. Putting this in draft till it's fixed.

@Griffin-Sullivan Griffin-Sullivan marked this pull request as draft October 27, 2023 18:58
@Griffin-Sullivan
Copy link
Contributor

trigger: test-robottelo
pytest: tests/foreman/maintain/test_upgrade.py -k test_negative_pre_upgrade_tuning_profile_check

@Griffin-Sullivan
Copy link
Contributor

trigger: test-robottelo
pytest: tests/foreman/maintain/test_upgrade.py -k test_negative_pre_upgrade_tuning_profile_check

@Griffin-Sullivan Griffin-Sullivan marked this pull request as ready for review November 15, 2023 13:07
@JacobCallahan JacobCallahan merged commit ca52622 into SatelliteQE:master Dec 4, 2023
7 checks passed
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 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