kubernetes-sigs / cluster-api-provider-azure

Cluster API implementation for Microsoft Azure
https://capz.sigs.k8s.io/
Apache License 2.0
291 stars 421 forks source link

Improve unit test coverage in the controllers package #3649

Open willie-yao opened 1 year ago

willie-yao commented 1 year ago

/kind cleanup

What needs cleanup: This mega issue is meant to track individual issues for improving code coverage within the controllers package.

Describe the solution you'd like

### Controllers Needing Unit Tests
- [ ] https://github.com/kubernetes-sigs/cluster-api-provider-azure/issues/3360
- [ ] https://github.com/kubernetes-sigs/cluster-api-provider-azure/issues/4114
- [ ] https://github.com/kubernetes-sigs/cluster-api-provider-azure/issues/4227
- [ ] https://github.com/kubernetes-sigs/cluster-api-provider-azure/issues/4267
- [ ] azurejson_machine_controller.go
- [ ] azurejson_machinepool_controller.go
- [ ] azurejson_machinetemplate_controller.go
- [ ] azuremanagedcluster_controller.go
- [ ] azuremanagedcontrolplane_controller.go
- [ ] azuremanagedcontrolplane_reconciler.go
- [ ] azuremanagedmachinepool_controller.go
- [ ] azuremanagedmachinepool_reconciler.go
- [ ] helpers.go

Older parent issue: https://github.com/kubernetes-sigs/cluster-api-provider-azure/issues/3229

aniruddha2000 commented 11 months ago

Hi @willie-yao I can take this one by one, but I need little more context, can youhelp?

willie-yao commented 11 months ago

Awesome @aniruddha2000, thanks for working on this! Basically, most controllers and reconcilers within the controllers package do not have unit tests, or have very basic ones. I have created more detailed unit tests for the AzureMachine controller and reconciler as an example, and you can implement tests for other controllers similar to it: #3360

aniruddha2000 commented 10 months ago

@willie-yao can you create the issue for next azurecluster_reconciler.go as well? I will start this week if possible

aniruddha2000 commented 10 months ago

the AzureClusterReconciler is done as we discuss, can you create the issue for the next one @willie-yao ?

willie-yao commented 10 months ago

@aniruddha2000 Done, feel free to assign yourself when you're ready to work on it!

troy0820 commented 10 months ago

@willie-yao I was going to create an issue for the azuremanagedcluster_controller unit test and assign it to myself. I can update this issue when that is done.

troy0820 commented 10 months ago

The issue is linked above but here is the link to edit the intial description: https://github.com/kubernetes-sigs/cluster-api-provider-azure/issues/4270

troy0820 commented 10 months ago

New issue created https://github.com/kubernetes-sigs/cluster-api-provider-azure/issues/4277

PR is coming soon.

troy0820 commented 10 months ago

New issue created https://github.com/kubernetes-sigs/cluster-api-provider-azure/issues/4290

PR is coming soon

troy0820 commented 9 months ago

/reopen

This was closed because it was listed on the PR I submitted. (Won't do that again)

k8s-ci-robot commented 9 months ago

@troy0820: Reopened this issue.

In response to [this](https://github.com/kubernetes-sigs/cluster-api-provider-azure/issues/3649#issuecomment-1821512618): >/reopen > >This was closed because it was listed on the PR I submitted. _(Won't do that again)_ Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
k8s-triage-robot commented 6 months ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

willie-yao commented 6 months ago

/remove-lifecycle stale

k8s-triage-robot commented 3 months ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

willie-yao commented 3 months ago

/remove-lifecycle stale

k8s-triage-robot commented 3 weeks ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

troy0820 commented 3 weeks ago

/remove-lifecycle stale

troy0820 commented 3 weeks ago

/lifecycle frozen

Keeping this at frozen to not close