-
Notifications
You must be signed in to change notification settings - Fork 772
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
Add tests to the codebase #413
Comments
Completely agree. I have set up the CI for the controller, but since there were no tests on the cyctl, I didn't add the tests there. If you would like to add tests to cyctl, you can change this GH action to run them on each push. |
Hey @thebigbone, do you have any updates on this? |
Hey I have not made much progress because of less spare time. I am planning to atleast cover the half of cli in the next week! |
Cool, thanks |
@petar-cvit should we use |
@thebigbone I think it's good enough to test it with unit tests without setting up the cluster, at least for start. We can add tests that require a cluster later on |
Hey @thebigbone, do you have any update on |
Hey, I should have asked this before but I am stuck at what tests would be sufficient. Should I just compare the output buffer only or should I create fake clientsets for kubernetes commands? Apologies for the delay. |
@thebigbone you can create a mock for clientset? You can create and use an interface in the code and then pass a mock in tests |
Mock of the k8s client right? And what about the module commands? |
@thebigbone you can take an interface here instead of passing Same goes for other actions also. We are using ginkgo and gomega for testing in |
Hey @thebigbone, did you manage to create some tests for the |
@petar-cvit interested to add tests for the cyctl command line. Shall I start creating the unit tests ? |
@Abiji-2020 sure thing, will assign you |
@Abiji-2020 I made a K8s client mock you can use in your tests. Still on a PR, but you can branch out from there and implement tests for cyctl. Here is the PR cc @thebigbone |
@petar-cvit thanks very much I am finding it hard to create a mock. you helped me 🧡
|
I think we should start adding tests and possibly add it to the CI as well? I can start with the cli and aim for a good coverage score
The text was updated successfully, but these errors were encountered: