-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Need references/documentation for unit testing #3511
Comments
We recommend following this kubebuilder testing guide, which we should link in documentation. /kind documentation |
Hi @kaushiksrinivas, However, the same doc that you are looking for is in : https://sdk.operatorframework.io/docs/golang/legacy/unit-testing/. Note that SDK is in a process to be integrated with KB which means that its project layouts will be aligned. More info : Integrating Kubebuilder and Operator SDK. So, for the new layout test files for your controller are scaffold and then, you can follow up the docs suggested by @estroz as well. |
Hi @camilamacedo86 Currently if anyone is already using operator-sdk, what changes are expected ? |
Hi @kaushiksrinivas,
Yes, for 1.0.0 the legacy layout will no longer be supported.
You can check the migration guide to know how to upgrade your projects. See the PR #3543 for we shape it better. Note that in the first comment has a link where you can preview the doc. See that |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
hi @camilamacedo86, @estroz @joelanford Operator SDK includes an e2e testing framework that simplifies testing your operator against an actual cluster. Does this mean that the e2e test framework of operator-sdk will be removed and no longer supported and one needs to follow the kube-builder way of testing ? Does this mean https://sdk.operatorframework.io/docs/golang/legacy/unit-testing/. this is no longer valid with latest version(v0.19) of operator-sdk ? |
Hi @britoaldan, I flagged it to be discussed in the Bug Triage meeting. Please, feel free to attend. |
Hi @camilamacedo86 |
Hi @kaushiksrinivas, @beautytiger, See the details over the meetings in: https://github.com/operator-framework/community As an update from the discussion made see:
We will keep this issue to track the need to provide the docs for the tests. |
If one builds operator with v0.19 with the new scaffolding structure. Also we see envtest is for integration testing, will there be a framework available for unit test ? |
Hi @britoaldan, Following the comments.
You can check the migration guide for GO already. However, it requires some fixes and updates. Because of this, I'd suggest you check and follow it via the changes made in the PR #3543. See that there you will find the preview link for the doc https://deploy-preview-3543--operator-sdk.netlify.app/docs/building-operators/golang/project_migration_guide/.
See that SDK so far is in a version <
Now, the SDK will generate tests for your projects. These tests are using ginkgo/ and gomega, look its imports:
I'd recommend you follow up and use that since this stack is adopted across the k8ss projects used by it and SDK now. To know more about how to test check the doc : https://book.kubebuilder.io/reference/writing-tests.html?highlight=controller,test#writing-controller-tests |
Hi @camilamacedo86 Is there any unit test framework which can be used or one must follow the link Thanks, |
HI @kaushiksrinivas, The documentation in upstream was updated with an example. Also, see that a PR was raised to share the info which was already provided here via the docs as well #3823. Also, we are clarifying on it that scorecard and kuttl also can be used to test the project. |
…3823) **Description of the change:** doc: add base doc to clarifies how users can test their projects **Motivation for the change:** Many users have raised these questions. The goal of this doc is to provide the basic information and the links/references for they are able to move forward. It can be improved by the community and/or in the post 1.0 doc plans. Closes: #3511
…perator-framework#3823) **Description of the change:** doc: add base doc to clarifies how users can test their projects **Motivation for the change:** Many users have raised these questions. The goal of this doc is to provide the basic information and the links/references for they are able to move forward. It can be improved by the community and/or in the post 1.0 doc plans. Closes: operator-framework#3511
Hi
Looking for documentation/examples on unit testing the operator sdk project.
links referred in some of the bugs seems to be no more available
https://github.com/operator-framework/operator-sdk/blob/master/doc/user/unit-testing.md
Can anyone provide documentation link for unit testing and any example implementations ?
Thanks in advance
Kaushik.
The text was updated successfully, but these errors were encountered: