-
Notifications
You must be signed in to change notification settings - Fork 115
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 Upgrade scenarios #16477
Fix Upgrade scenarios #16477
Conversation
12edf99
to
60ac9ff
Compare
60ac9ff
to
428c0bc
Compare
trigger: test-robottelo |
PRT Result
|
tests/upgrades/test_discovery.py
Outdated
@@ -60,5 +60,5 @@ def test_post_upgrade_fdi_version(self, target_sat, pre_upgrade_data): | |||
fdi_package = target_sat.execute('rpm -qa *foreman-discovery-image*').stdout | |||
# Note: The regular exp takes care of format digit.digit.digit or digit.digit.digit-digit in the output | |||
post_upgrade_version = Version(re.search(r'\d+\.\d+\.\d+(-\d+)?', fdi_package).group()) | |||
assert post_upgrade_version >= pre_upgrade_version | |||
assert str(post_upgrade_version) >= pre_upgrade_version |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
comparing versions here make more sense here, so just would like to know why this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since we dictionary doesn't accept Version so changing it to str.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shweta83 I didn't get, but as we discussed in our call we agreed to keep Version as is instead of comparing strings as its more effective
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dictionary saved in pre_upgrade scenario doesn't accept Version object so I tried a new workaround for it.
pre_update_data_dict = { | ||
'provision_host_id': host.id, | ||
'provision_host_name': host.name, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does host.id change after upgrade?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Host.name would be more reliable here. Id doesn't change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shweta83 I think it doesn't matter if use either name or id, both should be same, but I'd like to understand rational behind changing it from id to name
428c0bc
to
27f1a6a
Compare
trigger: test-robottelo |
PRT Result
|
(cherry picked from commit 1532b8e)
(cherry picked from commit 1532b8e)
(cherry picked from commit 1532b8e)
(cherry picked from commit 1532b8e)
Problem Statement
Provisioning Template and Foreman Discovery Upgrade Scenario tests are failing with JSON parse error.
Solution
test_pre_scenario_provisioning_templates
to save hostname instead of host id in pre_upgrade_data file.test_pre_upgrade_fdi_version
as Version type data is not supported to be stored.Related Issues