Skip to content
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

[Test] Refactor inject_webhook_test.go according to the Developer Guide #2401

Merged
merged 4 commits into from
Aug 16, 2024

Conversation

Electronic-Waste
Copy link
Member

What this PR does / why we need it:

I refactored /pkg/webhook/v1beta1/pod/inject_webhook_test.go with rule described in Developer Guide:

  1. Use cmp.Diff instead of reflect.Equal, to provide useful comparisons.
  2. Define test cases as maps instead of slices to avoid dependencies on the running order. Map key should be equal to the test case name.

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 #2388

Checklist:

  • Docs included if any changes are user facing

Signed-off-by: Electronic-Waste <2690692950@qq.com>
Signed-off-by: Electronic-Waste <2690692950@qq.com>
Signed-off-by: Electronic-Waste <2690692950@qq.com>
@Electronic-Waste Electronic-Waste changed the title [Test] Refactor inject_webhook.go according to the Developer Guide [Test] Refactor inject_webhook_test.go according to the Developer Guide Aug 1, 2024
Signed-off-by: Electronic-Waste <2690692950@qq.com>
@Electronic-Waste
Copy link
Member Author

I've added the missing UT which was deleted by accident now. PTAL👀 @tenzen-y if you have time.

Copy link
Member

@tenzen-y tenzen-y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!
/lgtm
/approve

Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tenzen-y

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

@google-oss-prow google-oss-prow bot merged commit 4a385f5 into kubeflow:master Aug 16, 2024
63 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Refactor /pkg/webhook/v1beta1/pod/inject_webhook_test.go according to Developer Guide.
2 participants