liquidmetal-dev / liquidmetal-dev/cluster-api-provider-microvm

Change controller tests to use envtest

Open
#30 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/testing kind/feature priority/important-soon
Dominant language
Go
Stars
157
Forks
21
PR merge metrics
No merged PRs in 30d

Description

**Describe the solution you'd like:**
We need to migrate the controller tests to use envtest in the future so that controller is tested in conjunction with the webhooks etc. This is the common pattern across infra providers.

See CAPA for an example:
- https://github.com/kubernetes-sigs/cluster-api-provider-aws/blob/main/controllers/suite_test.go
- https://github.com/kubernetes-sigs/cluster-api-provider-aws/blob/main/controllers/awscluster_controller_test.go

**Why do you want this feature:**

**Anything else you would like to add:**
[Miscellaneous information that will assist in solving the issue.]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the controller tests and compare their structure with the referenced CAPA suite_test.go and awscluster_controller_test.go examples. Migrate the tests to envtest so the controller is exercised together with webhooks, and verify the controller test suite passes.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.