refactor: change the group command to add unit tests#1818
Merged
kian99 merged 3 commits intocanonical:v3from Jan 21, 2026
Merged
refactor: change the group command to add unit tests#1818kian99 merged 3 commits intocanonical:v3from
kian99 merged 3 commits intocanonical:v3from
Conversation
ff02d6f to
c9ef512
Compare
ale8k
approved these changes
Jan 20, 2026
Contributor
ale8k
left a comment
There was a problem hiding this comment.
lgtm bar the newclient stuff and fmt.Errorf consistency.
SimoneDutto
approved these changes
Jan 20, 2026
c9ef512 to
f48c35f
Compare
kian99
commented
Jan 21, 2026
Comment on lines
49
to
51
| jimmAPIFunc: func(store jujuclient.ClientStore, dialOpts *api.DialOpts) (JIMMAPI, error) { | ||
| return cmdMocks.client, nil | ||
| }, |
Contributor
Author
There was a problem hiding this comment.
Just a heads up on this change @ale8k, I need to pass in a store here since some of the other commands that are still integration testing, are re-using the addGroup command. Without being able to mock the store I can't run the command in an integration test.
f48c35f to
51b7cfa
Compare
There was an attempt to simplify the client logic and create a `NewClient` method that client methods can use but the method `NewAPIRootWithDialOpts` needs is a little involved and requires initialisation and would panic unless initialised. Reverting the change until we find a better approach.
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.
Description
This PR refactors the group-related commands to add unit tests. I also found a bug in the
remove-groupcommand where the force flag had an incorrect name.Fixes JUJU-9005
Engineering checklist