-
Notifications
You must be signed in to change notification settings - Fork 127
Change 2 tests to use dummy_bootc_host #19998
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
Open
sambible
wants to merge
1
commit into
SatelliteQE:master
Choose a base branch
from
sambible:bootc-dummy-host-change
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Hey there - I've reviewed your changes - here's some feedback:
- Avoid shadowing the dummy_bootc_host fixture by reassigning it when you do the API search—use a new variable name to keep the original fixture intact.
- You have several nearly identical assertions against content_facet_attributes—consider looping over the expected keys and values to reduce duplication.
- Both tests begin by calling register and checking .subscribed on dummy_bootc_host—factoring that into a small helper or custom fixture could make the tests cleaner.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Avoid shadowing the dummy_bootc_host fixture by reassigning it when you do the API search—use a new variable name to keep the original fixture intact.
- You have several nearly identical assertions against content_facet_attributes—consider looping over the expected keys and values to reduce duplication.
- Both tests begin by calling register and checking .subscribed on dummy_bootc_host—factoring that into a small helper or custom fixture could make the tests cleaner.
## Individual Comments
### Comment 1
<location> `tests/foreman/ui/test_imagemode.py:87` </location>
<code_context>
def test_bootc_host_details(target_sat, dummy_bootc_host, function_ak_with_cv, function_org):
"""Create a bootc host, and read it's information via the Host Details UI
:id: 842356e9-8798-421d-aca6-0a1774c3f22b
:expectedresults: Host Details UI contains the proper information for a bootc host
:Verifies:SAT-27171
"""
bootc_dummy_info = json.loads(DUMMY_BOOTC_FACTS)
assert (
dummy_bootc_host.register(function_org, None, function_ak_with_cv.name, target_sat).status
== 0
)
assert dummy_bootc_host.subscribed
with target_sat.ui_session() as session:
session.organization.select(function_org.name)
values = session.host_new.get_details(
dummy_bootc_host.hostname, widget_names='details.bootc'
)
assert (
values['details']['bootc']['details']['running_image']
== bootc_dummy_info['bootc.booted.image']
)
assert (
values['details']['bootc']['details']['running_image_digest']
== bootc_dummy_info['bootc.booted.digest']
)
assert (
values['details']['bootc']['details']['rollback_image']
== bootc_dummy_info['bootc.rollback.image']
)
assert (
values['details']['bootc']['details']['rollback_image_digest']
== bootc_dummy_info['bootc.rollback.digest']
)
</code_context>
<issue_to_address>
**issue (code-quality):** Extract code out into function ([`extract-method`](https://docs.sourcery.ai/Reference/Default-Rules/refactorings/extract-method/))
</issue_to_address>
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
rigger: test-robottelo |
PRT Result
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
6.17.z
6.18.z
CherryPick
PR needs CherryPick to previous branches
PRT-Passed
Indicates that latest PRT run is passed for the PR
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem Statement
A few bootc tests should be using the dummy_bootc_host (This refers to the host being set with a "dummy" hosts facts file, so it can be verified consistently).
Solution
This changes those 2 tests to use that, and runs pre-commit cleanup on the UI file.