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

Improve Ginkgo/Gomega Test Practices in Scaffolded and e2e Tests #4424

Open
camilamacedo86 opened this issue Dec 13, 2024 · 1 comment
Open
Assignees
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. testing

Comments

@camilamacedo86
Copy link
Member

camilamacedo86 commented Dec 13, 2024

What do you want to happen?

Kubebuilder creates/scaffolds a lot of test code. This test code uses Ginkgo and Gomega. Some of the tests as written don't take full advantage of Gomega's testing framework. Since Kubebuilder is likely to introduce many developers to Gomega, it is important that the scaffolded code provides the best possible examples.

We should see that the tests scaffolded for end-users have this issue fixed already: testdata/project-v4/test.

What we need to do here is ensure that ALL our e2e tests are also following the same patterns as the end-user scaffolds. Therefore, the necessary changes must be implemented in: test/e2e.

Context

The context for this issue and similar discussions can be found here: kubernetes-sigs/kubebuilder#4135.

Tasks

  1. Review and compare the test scaffolds in testdata/project-v4/test to ensure best practices in Ginkgo/Gomega are being followed.
  2. Update all e2e tests in test/e2e to align with these patterns and provide the best examples for developers.
  3. Validate that the tests maintain readability while leveraging Gomega's framework effectively.

Extra Labels

/kind cleanup

@camilamacedo86 camilamacedo86 added the kind/feature Categorizes issue or PR as related to a new feature. label Dec 13, 2024
@k8s-ci-robot k8s-ci-robot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label Dec 13, 2024
@camilamacedo86 camilamacedo86 added testing good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. and removed kind/feature Categorizes issue or PR as related to a new feature. labels Dec 13, 2024
@Sijoma
Copy link
Contributor

Sijoma commented Dec 14, 2024

/assign

Sijoma added a commit to Sijoma/kubebuilder that referenced this issue Dec 14, 2024
Sijoma added a commit to Sijoma/kubebuilder that referenced this issue Dec 22, 2024
Sijoma added a commit to Sijoma/kubebuilder that referenced this issue Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. testing
Projects
None yet
Development

No branches or pull requests

3 participants