You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a goal to reach 70% of code coverage in the kubewarden controller repository. For that, we can improve the coverage of the controllers package. Considering the current metric of the package, it's virtually reached the 70%, the current coverage is 69.67%.
However, when we take a look on the individual files is possible to see that some of them need some improvement. The only two files under the 70% threshold is policyserver_controller.go (58.43%) and policystatus_utils.go (59.52%).
In the case of the policyserver_controller.go, most of the lines missing the coverage is the lines where errors are returned and requeue the reconciliation loop. I believe we can cover this line by doing some mocking and unit tests.
For the policystatus_utils.go file besides the lines returning when some error happen. There are some call to apimeta to set status conditions which are not being tested. I believe we can try to use some mock and unit tests to tests this lines as well.
Acceptance criteria
Improve the policyserver_controller.go code coverage to reach close to 70% coverage
Improve the policystatus_util.go test to cover the missing SetStatusCondition calls and reach close to 70% coverage
The text was updated successfully, but these errors were encountered:
I think we should tackle #660 before we go and improve the code coverage of the PolicyServer reconciliation loop. That's because there's quite some code we can delete once we address the linked issue
We have a goal to reach 70% of code coverage in the kubewarden controller repository. For that, we can improve the coverage of the
controllers
package. Considering the current metric of the package, it's virtually reached the 70%, the current coverage is 69.67%.However, when we take a look on the individual files is possible to see that some of them need some improvement. The only two files under the 70% threshold is
policyserver_controller.go
(58.43%) andpolicystatus_utils.go
(59.52%).In the case of the
policyserver_controller.go
, most of the lines missing the coverage is the lines where errors are returned and requeue the reconciliation loop. I believe we can cover this line by doing some mocking and unit tests.For the
policystatus_utils.go
file besides the lines returning when some error happen. There are some call to apimeta to set status conditions which are not being tested. I believe we can try to use some mock and unit tests to tests this lines as well.Acceptance criteria
policyserver_controller.go
code coverage to reach close to 70% coveragepolicystatus_util.go
test to cover the missingSetStatusCondition
calls and reach close to 70% coverageThe text was updated successfully, but these errors were encountered: