aws / aws/eks-anywhere

Refactor cloudstack provider tests to be in different package

Open
#3,921 0 comments 0 reactions 0 assignees View on GitHub
area/providers/capc team/cli
Dominant language
Go
Stars
2.1k
Forks
328
Avg merge
1d 4h
Merged PRs (30d)
9

Description

**What would you like to be added**:
The cloudstack provider unit tests currently reside in the cloudstack package. This means that if mocks are generated and depend on the cloudstack package as well due to some type definitions, we end up with a circular dependency from cloudstack -> mocks -> cloudstack. We should instead refactor the cloudstack provider tests to be in their own package, `cloudstack_tests`. This also requires removing the dependency on unexported fields in the cloudstack.Spec object from the provider code.

The vsphere provider recently underwent these changes.

**Why is this needed**:
Mock generation results in circular dependencies.

Contributor guide

Open the contributing guide

Research direction

Start by comparing the cloudstack provider tests and cloudstack.Spec usage with the corresponding changes recently made for the vsphere provider. Refactor the tests into the cloudstack_tests package, remove their reliance on unexported Spec fields, and verify that mock generation no longer creates a circular dependency.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
infrastructure, testing-qa
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.