cluster-api-provider-aws icon indicating copy to clipboard operation
cluster-api-provider-aws copied to clipboard

🌱 Add basic unit test for EKS `AWSManagedControlPlaneReconciler`

Open AndiDog opened this issue 1 year ago • 2 comments
trafficstars

What type of PR is this?

/kind support

What this PR does / why we need it:

The EKS reconciliation was not covered in unit tests at all, making it hard to contribute changes with confidence. So like for AWSCluster reconciliation, I added a similar type of test that checks the basic creation of a cluster and the expected AWS API calls.

This meant to fix a few small things along the way, such as version parsing which ignored errors or panicked until now.

Checklist:

  • [x] squashed commits
  • [ ] includes documentation
  • [x] includes emojis
  • [x] adds unit tests
  • [ ] adds or updates e2e tests

Release note:

NONE

AndiDog avatar Feb 22 '24 10:02 AndiDog

/test pull-cluster-api-provider-aws-build-docker

AndiDog avatar Mar 05 '24 16:03 AndiDog

/test pull-cluster-api-provider-aws-e2e-eks

AndiDog avatar Mar 26 '24 09:03 AndiDog

This is really helpful @AndiDog, could you please add what all tests have you covered as part of description? It would be helpful in the review.

Ankitasw avatar Mar 27 '24 05:03 Ankitasw

@Ankitasw Added some more description, but really it's "just" about making the controller testable and adding a basic test AWSManagedControlPlane creation with managed VPC. I didn't want to blow up the PR size by adding much more. Adding more tests will be much easier after this.

AndiDog avatar Apr 11 '24 08:04 AndiDog

Thanks @AndiDog. This is really helpful and as a base it will enable us to improve our test coverage on the EKS side. From my side:

/approve

richardcase avatar Apr 12 '24 08:04 richardcase

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: richardcase

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment Approvers can cancel approval by writing /approve cancel in a comment

k8s-ci-robot avatar Apr 12 '24 08:04 k8s-ci-robot

@cnmcavoy @faiq do you have a chance to review this? Thanks 😉

AndiDog avatar Apr 15 '24 13:04 AndiDog

/lgtm

cnmcavoy avatar Apr 15 '24 16:04 cnmcavoy