Closed jvanz closed 1 month ago
Attention: Patch coverage is 84.98024%
with 38 lines
in your changes are missing coverage. Please review.
Project coverage is 73.84%. Comparing base (
66fac8e
) to head (5adaba0
).
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@kubewarden/kubewarden-developers I take this opportunity to verify some of the policy controller flaky test that we can see in the main branch. I could hit this test failing regularly in this branch. Therefore, I've started by reorganizing the tests to be independent. This way I can run the problematic test individually. That's why, you can see another test reorganization in the policy controller tests. ;)
@kubewarden/kubewarden-developers I've split this PR into two. The second one, #731, has the test reorganization that I did while working on this change. As the tests added in this PR require the changes on #731, this PR is based on that changes. Thus, #731 should be merge before.
Moving this PR to block until we merge #731. Once it's merged, I'll rebase this on top of main again and we will have a cleaner diff.
@fabriziosestito I've addressed your comments. Can you review it again? Thanks!
Description
This PR updates the controller code responsible to update the policy server resources to use the controller-runtime
CreateOrUpdate
helper function to abstract the logic of detecting if the resource should be created or updated. Making the code more simple and easy to maintain.During this process the unit tests testing the removed code have been removed as well. Which bring us to the spin off PR of this one, the integration tests reorganization #731 . The old tests have been reorganized to describe better the context of what the tests are validating. As well as updating the whole policy server controller tests to be independent as suggested by the Ginkgo documentation. After that, to ensure that the controller continue to works as before a bunch of integrations tests have been added covering the removed unit tests
~NOTE: I've not added test to cover the metrics configurations yet. I'll add a future PR to cover that. I do not want to wait more in this PR to get some feedback from the team.~ This is not necessary anymore. I've added tests for the metrics and tracing configuration here as well.
Fix https://github.com/kubewarden/kubewarden-controller/issues/723
Test
Additional information