-
Notifications
You must be signed in to change notification settings - Fork 243
Mocking framework for unit test #4076
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
Comments
we need to have interfaces accross the code to allowing mocking. so we need a pre-req issue over it |
@prietyc123 as part of research can you please pick up an interface from the code and mock it with both the framework to see what makes sense |
I have looked into the odo code and found the interface at one place within the devfile https://github.com/openshift/odo/blob/master/pkg/devfile/adapters/common/interface.go and tried mocking it with Example: Once we are done with refactoring and get the interface I will start implementing the unit test with one of the dev team member, I think mrinal would be best person for this because he has worked a lot on this. @kadel @girishramnani Please let me know your suggestions on this. Also @mik-dass please add your point too if I missed something. |
Two different mocking structure with interface https://github.com/openshift/odo/blob/a28e37838c5cbaa396f6675fe90a9986168165f5/pkg/envinfo/envinfo.go#L90-L97 Gomock:
Testify:
I am still working on the unit test part and will try to update the tests asap. For now we can compare both the mocking framework structure of the same interface. |
We need to convert this into an epic and add track all the testing refactor under this |
Issues go stale after 90d of inactivity. Mark the issue as fresh by commenting If this issue is safe to close now please do so with /lifecycle stale |
@prietyc123: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Uh oh!
There was an error while loading. Please reload this page.
/kind user-story
User Story
As a dev/QE I want to write unit test for the function which has dependency on packages, registry, interfaces etc.
Acceptance Criteria
Links
/kind user-story
The text was updated successfully, but these errors were encountered: