openshift / installer

Install an OpenShift 4.x cluster
https://try.openshift.com
Apache License 2.0
1.44k stars 1.39k forks source link

[release-4.17] CORS-3753: Allow mocking of the Azure client everywhere #9219

Closed zaneb closed 6 days ago

zaneb commented 1 week ago

Currently the Azure client can only be mocked in unit tests of the pkg/asset/installconfig/azure package. Using the mockable interface consistently and adding a public interface to set it up will allow other packages to write unit tests for code involving the Azure client.

This is a backport from #9201

openshift-ci-robot commented 1 week ago

@zaneb: This pull request references CORS-3753 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target either version "4.17." or "openshift-4.17.", but it targets "4.18.0" instead.

In response to [this](https://github.com/openshift/installer/pull/9219): >Currently the Azure client can only be mocked in unit tests of the `pkg/asset/installconfig/azure` package. Using the mockable interface consistently and adding a public interface to set it up will allow other packages to write unit tests for code involving the Azure client. > >This is a backport from #9201 Instructions for interacting with me using PR comments are available [here](https://prow.ci.openshift.org/command-help?repo=openshift%2Finstaller). If you have questions or suggestions related to my behavior, please file an issue against the [openshift-eng/jira-lifecycle-plugin](https://github.com/openshift-eng/jira-lifecycle-plugin/issues/new) repository.
zaneb commented 1 week ago

/label backport-risk-assessed /cc @patrickdillon

As discussed, I will manually apply the valid-bug label. We are backporting this on the grounds that it affects internal APIs for unit tests only.

openshift-ci[bot] commented 1 week ago

@zaneb: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-azurestack 80bc5a8378330a10099b7fb263f05c1fc43f15f9 link false /test e2e-azurestack

Full PR test history. Your PR dashboard.

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-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
sadasu commented 1 week ago

/approve

openshift-ci[bot] commented 1 week ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sadasu

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/openshift/installer/blob/release-4.17/OWNERS)~~ [sadasu] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
gpei commented 1 week ago

/label cherry-pick-approved

patrickdillon commented 6 days ago

/lgtm

openshift-ci-robot commented 6 days ago

/retest-required

Remaining retests: 0 against base HEAD 147f4d9a92750d243b1edbd77d08cd32ec71f795 and 2 for PR HEAD 80bc5a8378330a10099b7fb263f05c1fc43f15f9 in total

openshift-bot commented 6 days ago

[ART PR BUILD NOTIFIER]

Distgit: ose-installer-altinfra This PR has been included in build ose-installer-altinfra-container-v4.17.0-202411222304.p0.g7cb16ac.assembly.stream.el9. All builds following this will include this PR.

openshift-bot commented 6 days ago

[ART PR BUILD NOTIFIER]

Distgit: ose-baremetal-installer This PR has been included in build ose-baremetal-installer-container-v4.17.0-202411222304.p0.g7cb16ac.assembly.stream.el9. All builds following this will include this PR.

openshift-bot commented 6 days ago

[ART PR BUILD NOTIFIER]

Distgit: ose-installer-terraform-providers This PR has been included in build ose-installer-terraform-providers-container-v4.17.0-202411222304.p0.g7cb16ac.assembly.stream.el9. All builds following this will include this PR.

openshift-bot commented 6 days ago

[ART PR BUILD NOTIFIER]

Distgit: ose-installer-artifacts This PR has been included in build ose-installer-artifacts-container-v4.17.0-202411222304.p0.g7cb16ac.assembly.stream.el9. All builds following this will include this PR.