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: added tests for mutating webhook analyzer #995

Merged
merged 2 commits into from
Mar 8, 2024

Conversation

VaibhavMalik4187
Copy link
Contributor

📑 Description

This commit introduces comprehensive tests for the mutating webhook analyzer defined in the pkg/analyzer package.

Adding these tests increases the code coverage of the mutating_webhook.go file to almost 95%.

Partially addresses: #889

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

@VaibhavMalik4187 VaibhavMalik4187 requested review from a team as code owners March 3, 2024 10:36
@VaibhavMalik4187 VaibhavMalik4187 force-pushed the mutating-webhook-tests branch from 55e9c18 to ec7e5ba Compare March 3, 2024 10:38
@VaibhavMalik4187
Copy link
Contributor Author

VaibhavMalik4187 commented Mar 4, 2024

@matthisholleville, The following lines indicate that if the service selectors are empty, this request should be deferred to the service analyzer. However, no call to the service analyzer is being made. Is this intentional?

// When Service selectors are empty we defer to service analyser

// When Service selectors are empty we defer to service analyser

@VaibhavMalik4187 VaibhavMalik4187 force-pushed the mutating-webhook-tests branch from ec7e5ba to fc6710e Compare March 5, 2024 14:52
Copy link
Contributor

@JuHyung-Son JuHyung-Son left a comment

Choose a reason for hiding this comment

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

lgtm.

and would you add comment that which webhook should be in results?

This commit introduces comprehensive tests for the mutating webhook
analyzer defined in the `pkg/analyzer` package.

Adding these tests increases the code coverage of the
`mutating_webhook.go` file to almost 95%.

Partially addresses: k8sgpt-ai#889

Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
@VaibhavMalik4187 VaibhavMalik4187 force-pushed the mutating-webhook-tests branch from fc6710e to 8fa3990 Compare March 6, 2024 05:55
@VaibhavMalik4187
Copy link
Contributor Author

lgtm.

and would you add comment that which webhook should be in results?

Done, and I've also added comments for the ValidatingWebhook tests.

@AlexsJones AlexsJones enabled auto-merge (squash) March 8, 2024 08:18
@AlexsJones AlexsJones merged commit 5199dad into k8sgpt-ai:main Mar 8, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants