k8gb icon indicating copy to clipboard operation
k8gb copied to clipboard

REFACTORING: Use DepResover mock in constroller tests

Open kuritka opened this issue 2 years ago • 2 comments

Use DepResover mock instead of settings := provideSettings(t, predefinedConfig) in constroller tests.

Using the settings object and calling reconcile is no longer sufficient. For example, the function works with k8gb.absa.oss_v1beta1_gslb_cr.yaml from which it generates a gslb for the tests. Any change to this file will cause the test to crash. We now have a depressolver mock (and a number of other mocks) that we can use for testing.

kuritka avatar Jul 20 '22 10:07 kuritka

@kuritka what's the status of this one, can we close it?

somaritane avatar Oct 09 '22 11:10 somaritane

Hi, not fully. Depresolver mock for tests is ready (#951), but controller tests would be refactored, to use this mock instead of direct instanptiating. Coverage requirement is still met but it's more about unify controller tests with mocks.

kuritka avatar Oct 10 '22 07:10 kuritka