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

Test for the change host's content source feature #14004

Merged

Conversation

LadislavVasina1
Copy link
Contributor

Problem Statement

Create a test for the change host's content source feature.

Solution

Fixture and test were created.
The fixture does the necessary setup on the satellite, host, and capsule.
Test exercises different ways how to change the host's content source.

Needs Airgun#1226.

@LadislavVasina1 LadislavVasina1 added CherryPick PR needs CherryPick to previous branches Auto_Cherry_Picked Automatically cherrypicked PR using GHA AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing 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 Feb 7, 2024
@LadislavVasina1 LadislavVasina1 self-assigned this Feb 7, 2024
@LadislavVasina1 LadislavVasina1 requested review from a team as code owners February 7, 2024 08:09
@LadislavVasina1
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/ui/test_host.py -k 'test_change_content_source'
airgun: 1226

Copy link
Member

@ogajduse ogajduse left a comment

Choose a reason for hiding this comment

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

ACK, three non-blocking comments left.
Great work, @LadislavVasina1!

tests/foreman/ui/test_host.py Outdated Show resolved Hide resolved
Comment on lines +2478 to +1850
capsule = module_target_sat.cli.Capsule.update(
{
'name': module_capsule_configured.hostname,
'organization-ids': org.id,
'location-ids': loc.id,
}
)
Copy link
Member

Choose a reason for hiding this comment

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

looking at the usage of capsule in the test, the value seems to be a list of capsules. Can you access the value on the first index and store it in capsule?

Suggested change
capsule = module_target_sat.cli.Capsule.update(
{
'name': module_capsule_configured.hostname,
'organization-ids': org.id,
'location-ids': loc.id,
}
)
capsule = module_target_sat.cli.Capsule.update(
{
'name': module_capsule_configured.hostname,
'organization-ids': org.id,
'location-ids': loc.id,
}
)[0]

tests/foreman/ui/test_host.py Outdated Show resolved Hide resolved
tests/foreman/ui/test_host.py Outdated Show resolved Hide resolved
tests/foreman/ui/test_host.py Show resolved Hide resolved
@LadislavVasina1 LadislavVasina1 force-pushed the change_content_host_source branch from ff08d2c to 883eeae Compare February 15, 2024 07:13
@Satellite-QE Satellite-QE added the PRT-Failed Indicates that latest PRT run is failed for the PR label Feb 15, 2024
@LadislavVasina1
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/ui/test_host.py -k 'test_change_content_source'
airgun: 1226
env:
  ROBOTTELO_server__deploy_workflows_product: 'deploy-satellite'
  ROBOTTELO_server__deploy_arguments__deploy_sat_version: 'stream'
  ROBOTTELO_server__deploy_arguments__deploy_snap_version: '46.0'

@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 Feb 15, 2024
@SatelliteQE SatelliteQE deleted a comment from Satellite-QE Feb 15, 2024
@Satellite-QE
Copy link
Collaborator

PRT Result

Build Number: 5749
Build Status: SUCCESS
PRT Comment: pytest tests/foreman/ui/test_host.py -k test_change_content_source
Test Result : ========= 2 passed, 39 deselected, 163 warnings in 2455.72s (0:40:55) ==========

@SatelliteQE SatelliteQE deleted a comment from Satellite-QE Feb 15, 2024
@SatelliteQE SatelliteQE deleted a comment from Satellite-QE Feb 15, 2024
@SatelliteQE SatelliteQE deleted a comment from Satellite-QE Feb 15, 2024
@pondrejk pondrejk merged commit 57db84f into SatelliteQE:master Feb 15, 2024
10 checks passed
github-actions bot pushed a commit that referenced this pull request Feb 15, 2024
* Test for change hosts content source

* Fix comment

* Set fixture to module scope

* Fix comments

* Add some asserts

* Add imports

* Remove comment

(cherry picked from commit 57db84f)
github-actions bot pushed a commit that referenced this pull request Feb 15, 2024
* Test for change hosts content source

* Fix comment

* Set fixture to module scope

* Fix comments

* Add some asserts

* Add imports

* Remove comment

(cherry picked from commit 57db84f)
shweta83 pushed a commit to shweta83/robottelo that referenced this pull request Apr 10, 2024
* Test for change hosts content source

* Fix comment

* Set fixture to module scope

* Fix comments

* Add some asserts

* Add imports

* Remove comment
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 Auto_Cherry_Picked Automatically cherrypicked PR using GHA 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.

5 participants