-
Notifications
You must be signed in to change notification settings - Fork 634
🌱 test: Add dedicated unit tests for getInstanceCPUOptionsRequest #5675
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hi @fangge1212. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
56003d5
to
c28d7ea
Compare
c28d7ea
to
10bc249
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/ok-to-test
func TestGetInstanceCPUOptionsRequest (t *testing.T) { | ||
testCases := []struct { | ||
name string | ||
instance *infrav1.Instance |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use only the infrav1.CPUOptions
type here, since the rest of infrav1.Instance
isn't even used in this test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right. Updated. Thanks.
0c130b1
to
868be8c
Compare
The unit tests for `getInstanceCPUOptionsRequest` are more lightweight and faster than testing various CPU option configurations through the larger `CreateInstance` function. This commit refactors the existing tests by moving the specific CPU option test cases from `TestCreateInstance` into a new, more focused `TestGetInstanceCPUOptionsRequest` function. A single test case remains in `TestCreateInstance` to ensure the integration between the functions is correct. Signed-off-by: Fangge Jin <[email protected]>
868be8c
to
090a6d9
Compare
Looks like an unrelated ROSA test failure. Maybe it's flaky, so let's try again. /test pull-cluster-api-provider-aws-test |
/lgtm |
LGTM label has been added. Git tree hash: bb56bbe701f5e2856dadbcf7f4ec09b55f4b590d
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: AndiDog 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 |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
The unit tests for
getInstanceCPUOptionsRequest
are more lightweight and faster than testing various CPU option configurations through the largerCreateInstance
function.This commit refactors the existing tests by moving the specific CPU option test cases from
TestCreateInstance
into a new, more focusedTestGetInstanceCPUOptionsRequest
function. A single test case remains inTestCreateInstance
to ensure the integration between the functions is correct.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 #
Special notes for your reviewer:
Checklist:
Release note: