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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃尡 Validating the warnings in tests #8778

Merged
merged 1 commit into from
Jun 9, 2023

Conversation

Dhairya-Arora01
Copy link
Contributor

What this PR does / why we need it: To validate the warnings in webhook unit tests

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

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 1, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @Dhairya-Arora01. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jun 1, 2023
@Dhairya-Arora01
Copy link
Contributor Author

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 1, 2023
Copy link
Contributor

@killianmuldoon killianmuldoon left a comment

Choose a reason for hiding this comment

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

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 1, 2023
@sbueringer
Copy link
Member

@Dhairya-Arora01 Looks good so far, that's what I meant!

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jun 1, 2023
@sbueringer
Copy link
Member

/assign @jackfrancis

@Dhairya-Arora01
Copy link
Contributor Author

/test pull-cluster-api-test-main

@Dhairya-Arora01
Copy link
Contributor Author

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 2, 2023
@jackfrancis
Copy link
Contributor

@Dhairya-Arora01 this looks gook, thanks!

Are there any "negative" test cases we can create for these warning responses? The equivalent of g.Expect(err).To(HaveOccurred()) for errors?

I assume we'll have to author new cases as the existing set of UT that you've backfilled w/ warnings responses are all nil.

@Dhairya-Arora01
Copy link
Contributor Author

@jackfrancis , So we need to write those cases where the warnings are not nil ?

@sbueringer
Copy link
Member

sbueringer commented Jun 9, 2023

@Dhairya-Arora01 this looks gook, thanks!

Are there any "negative" test cases we can create for these warning responses? The equivalent of g.Expect(err).To(HaveOccurred()) for errors?

I assume we'll have to author new cases as the existing set of UT that you've backfilled w/ warnings responses are all nil.

99% of our webhooks do not return any warnings in any case. Which makes sense as before CR v0.15 it was not possible to return warnings

@Dhairya-Arora01
Copy link
Contributor Author

@sbueringer , so we need to look for those 1% ?? and write negative test cases for those

@sbueringer
Copy link
Member

Now had time to look it up. Here's the 1% #8746. I thought it's already merged but it isn't.

So we're good

@Dhairya-Arora01
Copy link
Contributor Author

@sbueringer so we should wait for that pr to get merged?? or should we move on and after it gets merged open another one

@sbueringer
Copy link
Member

I think we should move on with this PR. If we want to change unit tests of the code introduced in #8746, this should be discussed and adressed in #8746.

@sbueringer
Copy link
Member

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 9, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 8e21a151c21de6c98d23fad69cdbec7936d5a002

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sbueringer

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 k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 9, 2023
@k8s-ci-robot k8s-ci-robot merged commit 530e7a3 into kubernetes-sigs:main Jun 9, 2023
19 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.5 milestone Jun 9, 2023
@Dhairya-Arora01 Dhairya-Arora01 deleted the webhookUnit branch June 9, 2023 10:39
@johannesfrey
Copy link
Contributor

/area testing

@k8s-ci-robot k8s-ci-robot added the area/testing Issues or PRs related to testing label Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/testing Issues or PRs related to testing cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Validate warnings in webhook unit tests
6 participants