Skip to content

Unit testing & refactor for pkg/client #67

@vharsh

Description

@vharsh

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    testingFor testing related enhancementswontfixThis will not be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions