Skip to content

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

@camilamacedo86

Description

@camilamacedo86

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

Metadata

Metadata

Assignees

Labels

good first issueDenotes an issue ready for a new contributor, according to the "help wanted" guidelines.kind/cleanupCategorizes issue or PR as related to cleaning up code, process, or technical debt.testing

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions