SAT-44548 coverage#22195
Merged
Merged
Conversation
Contributor
Reviewer's GuideAdds a new UI test to validate that bulk 'Change Location' using 'Select All' on the All Hosts page respects the current location context, ensuring only hosts in the selected location are moved while others remain unchanged. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The test currently assumes that
searchalways returns a single host and indexes[0]; consider asserting the number of results (e.g.,len(hosts) == 1) before indexing to make failures clearer and avoid hidden flakiness if extra hosts match the query. - Host creation for locations X and Y is duplicated; you could factor this into a small helper that creates N fake hosts for a given location and returns their names to reduce repetition and make the scenario setup easier to adjust.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The test currently assumes that `search` always returns a single host and indexes `[0]`; consider asserting the number of results (e.g., `len(hosts) == 1`) before indexing to make failures clearer and avoid hidden flakiness if extra hosts match the query.
- Host creation for locations X and Y is duplicated; you could factor this into a small helper that creates N fake hosts for a given location and returns their names to reduce repetition and make the scenario setup easier to adjust.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Contributor
Author
|
Collaborator
|
PRT Result |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
Bulk "Change Location" via "Select All" on the All Hosts page ignored the current location context and applied the change to all hosts across the Satellite, not just the ones visible in the selected location.
Solution
Added a UI test that verifies the fix from theforeman/foreman#11033.
The test creates hosts in two different locations, performs a bulk location change using "Select All" while scoped to one location, and asserts that only hosts from that location are moved while hosts in the other location remain unaffected.
PRT test Cases example
Summary by Sourcery
Tests: