metal3-io / cluster-api-provider-metal3

Metal³ integration with https://github.com/kubernetes-sigs/cluster-api
Apache License 2.0
208 stars 91 forks source link

:seedling: Add unit tests for duplicateProviderIDsExist #1726

Closed peppi-lotta closed 4 months ago

peppi-lotta commented 4 months ago

What this PR does / why we need it: Add unit tests for method duplicateProviderIDsExist (metal3machine_manager.go). A problem was detected and fixed in https://github.com/metal3-io/cluster-api-provider-metal3/pull/675. These unit tests will prevent errors hopefully.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged): Fixes #

Rozzii commented 4 months ago

/metal3-centos-e2e-integration-test-main /lgtm

Rozzii commented 4 months ago

/cancel lgtm

Rozzii commented 4 months ago

/lgtm cancel

Rozzii commented 4 months ago

Add please a test where both provider IDs are empty string, and the node count is 1 , that should cause no duplication error.

Rozzii commented 4 months ago

/test metal3-centos-e2e-integration-test-main /test metal3-ubuntu-e2e-integration-test-main

Rozzii commented 4 months ago

/lgtm

Rozzii commented 4 months ago

This PR only contains unit test changes thus it has no effect on e2e feature or e2e integration tests. /override metal3-centos-e2e-integration-test-main

Ubuntu e2e integration passed but Centos failed, it is most likely a CI issue anyways.

metal3-io-bot commented 4 months ago

@Rozzii: Overrode contexts on behalf of Rozzii: metal3-centos-e2e-integration-test-main

In response to [this](https://github.com/metal3-io/cluster-api-provider-metal3/pull/1726#issuecomment-2124318067): >This PR only contains unit test changes thus it has no effect on e2e feature or e2e integration tests. >/override metal3-centos-e2e-integration-test-main 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.
metal3-io-bot commented 4 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kashifest

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: - ~~[OWNERS](https://github.com/metal3-io/cluster-api-provider-metal3/blob/main/OWNERS)~~ [kashifest] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment