kubewarden-controller icon indicating copy to clipboard operation
kubewarden-controller copied to clipboard

Reach close to 70% code coverage in the `pkg` package

Open jvanz opened this issue 11 months ago • 1 comments

We have a goal to reach 70% of code coverage in the kubewarden controller repository. For that, we can improve the coverage of the pkg package. Considering the current metrics, this is the less covered package. However, I think that it's one of the most easy one to do. Most of the package is the types used in the controller. Therefore, to increase the coverage,simple unit tests verifying the methods should be enough.

I also think this can be done after the other packages. As the code does not have any major features, we may improve the coverage here by improving other packages coverage.

This is a spin off of #648

Acceptance criteria

  • [ ] Add unit tests for the types under the pkg to get close to 70% code coverage.

jvanz avatar Mar 01 '24 11:03 jvanz

Let's wait a bit before writing tests for the models. There are good chances portions of these files are going to be covered by the integration/new unit tests we will add.

Also, unless they have some special business logic done via methods, these files can also be ignored by the coverage report.

CC @fabriziosestito

flavio avatar Mar 01 '24 15:03 flavio