Skip to content

test: addcloudtocontroller unit test#1817

Merged
ale8k merged 7 commits intocanonical:v3from
ale8k:addcloudtocontroller-unit-test
Jan 20, 2026
Merged

test: addcloudtocontroller unit test#1817
ale8k merged 7 commits intocanonical:v3from
ale8k:addcloudtocontroller-unit-test

Conversation

@ale8k
Copy link
Contributor

@ale8k ale8k commented Jan 19, 2026

Description

Refactors add cloud to controller into a unit test. I've also added a single place to create JIMM API clients as:

  1. We're not dialing any real controller anymore, so we don't care about the store
  2. It removes the need to do "newClient" in every command and use the store. The store seems to only be used to dial for our cmd.

Engineering checklist

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

Test instructions

@ale8k ale8k requested a review from a team as a code owner January 19, 2026 11:45
@ale8k ale8k changed the title Addcloudtocontroller unit test test: addcloudtocontroller unit test Jan 19, 2026
}

func (s *addCloudToControllerSuite) TestAddCloudToController(c *gc.C) {
c.Skip("This test is failing since 3.6.12 since the providers moved to internal.")
Copy link
Contributor

Choose a reason for hiding this comment

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

We have a card on the backlog to fix this, since we are removing this please check that we have an equivalent test for this in our e2e testing suite.

Copy link
Contributor

Choose a reason for hiding this comment

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

Taking another look at this, I recall that it was the CLI logic that was failing to parse a cloud due to the lack of providers. I believe we still need some kind of test that will be failing due to this issue.

@ale8k ale8k force-pushed the addcloudtocontroller-unit-test branch from be5ddda to e63c375 Compare January 20, 2026 08:43
Copy link
Contributor

@kian99 kian99 left a comment

Choose a reason for hiding this comment

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

Just requesting changes to override my previous approval. We need a test like the previous TestAddCloudToController that is verifying the parsing of clouds logic.

ale8k added 6 commits January 20, 2026 11:18
Instead of using the entire ReadCloudFromFile call, we simply parse the metadata ourselves and let
the controller validate the clouds keys. This way it doesn't matter if the parsing logic is internal
to the provider.
@ale8k ale8k force-pushed the addcloudtocontroller-unit-test branch from 1a2d665 to deb2313 Compare January 20, 2026 11:18
@ale8k ale8k merged commit 51a8b13 into canonical:v3 Jan 20, 2026
9 of 10 checks passed
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.

3 participants