-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Enhance e2e Test by Adding a Method to Generate Project without Webhooks #3618
Comments
Hello @camilamacedo86 I pretty much interested in this issue because its needed and two pr are on hold because of this. I want to work on this issue but I have no experience working with tests. Can you please help me like how to start? What should I refer to ? It will be a great help. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
@camilamacedo86 I understood that the we need to add a new block in v4 func to validate the test without gnerating a webhook. I am confused in which tag/label is to use. Also I have never wrote tests so I wonder how it will be written with a logic. |
I created a cluster named kubebuilder. |
HI @Sajiyah-Salat,
To know what targets the project has and how to use them you can:
|
@camilamacedo86 @Sajiyah-Salat am I free to assign myself on this? |
Hello @typeid I am trying to work on this. But we can work together as well. |
kubebuilder/test/e2e/v4/generate_test.go Line 211 in f474467 From what I have understand we need to add new method here just like this but without this block. Please let me know if I have understood it fully or now. Also do we just need to add go codeblock or also to write script or it will cover directly in end to end script. |
Hi @Sajiyah-Salat, At the moment, we have a singular test where we scaffold APIs + webhooks and enable all options. Our goal is to create another mock, akin to Here are the steps broken down:
It("should generate a runnable project without webhooks"+
" with restricted pods", func() {
kbc.IsRestricted = true
GenerateV4WithoutWebhooks(kbc)
Run(kbc, false) // here you are passsing false to for a bool like hasWebhooks so that you can skip the webhooks checked based on it
}) For your new mock test So that means you need to do something like: func Run(kbc *utils.TestContext, hasWebhooks bool) {
if hasWebhooks {
// Check 1 code
}
if hasWebhooks {
// Check 2 code
}
} I hope that helps you out. |
Thanks for the detailed answer I will execute it soon and create a tested pr as well. |
on the second point you are talking about not uncommenting. From that you mean I should not uncomment the yaml file or not to write the uncomment code that you have selected in point 2. |
in second check we are validating webhook which is not the goal. do we need to pass that check. really? |
Also after passing the check the work is done I dont need to write the script or if else condition that it should pass two checks. You have given that just for understanding purpose. or should I write. |
Sorry for asking so many doubts. I just want to be clear before opening a pr. |
Addressing this issue was more intricate than initially anticipated. The primary approach involved adding tests that, as expected, highlighted the failure points. The plan was to then introduce a fix that would cause these tests to pass, indicating the issue was resolved. However, upon a closer examination, it became evident that the preliminary solution wouldn't adequately address the root of the problem. As a result, I've had to revisit our strategy. I've made revisions to both the corrective approach and the tests to ensure robustness. For details on these changes and the final solution, please refer to the updated PR linked below: |
What do you want to happen?
Description:
In the current e2e tests, we enable both cert-manager and webhooks to verify if everything functions as expected. The respective code can be found here: generate_test.go#L37-L210.
Task Details:
Additional Information:
This enhancement ensures that we are better testing the possible configurations, both with and without webhooks. It will ensure that changes like: #3585 does not broke the default scaffold.
Extra Labels
No response
The text was updated successfully, but these errors were encountered: