Skip to content
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

Unit testing & refactor for pkg/client #67

Open
Tracked by #49
vharsh opened this issue Jul 26, 2021 · 0 comments
Open
Tracked by #49

Unit testing & refactor for pkg/client #67

vharsh opened this issue Jul 26, 2021 · 0 comments
Labels
testing For testing related enhancements wontfix This will not be worked on

Comments

@vharsh
Copy link
Member

vharsh commented Jul 26, 2021

Currently openebsctl project has a K8sClient, which encapsulates all required typed clients for reaching the k8s-apis. Due to the nature of the codebase & huge options, this project sometimes needs a slice of objects and sometimes it needs a the objects mapped to some key. It is the mapping part of the codebase which is repetitive, this can be avoided by casting it to some generic values in such a way that the code outside pkg/client doesn't need modification & no interfaces{} or runtime.Object or metav1.Unstructured are used outside the client package & possible panics() are taken care by strong UTs.

  • Methods with a single line do not need unit test coverage
  • But methods with mapping logic or some other business logic needs to be tested
@vharsh vharsh changed the title pkg/client Unit testing & refactor for pkg/client Jul 26, 2021
@vharsh vharsh added the good first issue Good for newcomers label Jul 26, 2021
@vharsh vharsh added wontfix This will not be worked on and removed good first issue Good for newcomers labels Jan 28, 2022
@Abhinandan-Purkait Abhinandan-Purkait added the testing For testing related enhancements label Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing For testing related enhancements wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants