Skip to content

test: refactor destroy controller test away from gocheck#1828

Merged
kian99 merged 1 commit intocanonical:v3from
kian99:destroy-controller-cmd
Jan 22, 2026
Merged

test: refactor destroy controller test away from gocheck#1828
kian99 merged 1 commit intocanonical:v3from
kian99:destroy-controller-cmd

Conversation

@kian99
Copy link
Contributor

@kian99 kian99 commented Jan 22, 2026

Description

This PR refactors the destroy-controller commands tests away from gocheck. There was no refactoring to the implementation since it was already mocking the API connection.

Fixes JUJU-9006

Engineering checklist

  • Documentation updated
  • Covered by unit tests
  • Covered by integration tests

@kian99 kian99 requested a review from a team as a code owner January 22, 2026 14:30
@kian99 kian99 merged commit 9a784f9 into canonical:v3 Jan 22, 2026
8 checks passed
for i, test := range tests {
c.Log("Test ", i)
command := &destroyControllerCommand{}
command.SetClientStore(jujuclienttesting.MinimalStore())
Copy link
Contributor

Choose a reason for hiding this comment

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

Didn't know about MinimalStore - nice!

c.Assert(err, qt.IsNil)
}

func TestWatchLogs(t *testing.T) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Would be good to have a test for the prompting? We could pass a buffer to our own cmd.Ctx and capture what it writes, and then even test the success using the prompt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants