Skip to content

How do I actively test my code while developing #3768

Closed Answered by camilamacedo86
awalvie asked this question in Support
Discussion options

You must be logged in to vote

Hi @awalvie,

Overview

To validate your controller logic, you can use ENVTEST. Check out the examples under the controllers to create the suite and the test for each controller here. Note that you should have a test for each controller.

Additionally, you can perform end-to-end (e2e) tests to check your solution, with an example available under the testdata here. When creating a project with the Kubebuilder CLI, an initial scaffold is provided in test/e2e for your e2e tests. You can also refer to suite_test.go for using envtest.

If you use the Deploy Image plugin (more information here), it generates the scaffold to deploy and manage an image, including an implemented test. See this example h…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@awalvie
Comment options

Answer selected by camilamacedo86
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Support
Labels
None yet
2 participants