kubewarden / kubewarden-controller

Manage admission policies in your Kubernetes cluster with ease
https://kubewarden.io
Apache License 2.0
182 stars 30 forks source link

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

Open jvanz opened 4 months ago

jvanz commented 4 months ago

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

flavio commented 4 months ago

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