From ba6983153a6c37dbb24975ae9c12516c4e8b9b6b Mon Sep 17 00:00:00 2001 From: Felix Kunde Date: Tue, 13 Apr 2021 10:59:17 +0200 Subject: [PATCH] add more comments to unit test --- pkg/cluster/sync_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/cluster/sync_test.go b/pkg/cluster/sync_test.go index 3694226fb..10c015ed6 100644 --- a/pkg/cluster/sync_test.go +++ b/pkg/cluster/sync_test.go @@ -57,7 +57,6 @@ func TestSyncStatefulSetsAnnotations(t *testing.T) { DefaultCPULimit: "300m", DefaultMemoryRequest: "300Mi", DefaultMemoryLimit: "300Mi", - InheritedAnnotations: []string{"test-anno"}, PodRoleLabel: "spilo-role", ResourceCheckInterval: time.Duration(3), ResourceCheckTimeout: time.Duration(10), @@ -88,6 +87,7 @@ func TestSyncStatefulSetsAnnotations(t *testing.T) { cluster.Statefulset = newSts // first compare running with desired statefulset - they should not match + // because no inherited annotations or downscaler annotations are configured desiredSts, err := cluster.generateStatefulSet(&cluster.Postgresql.Spec) assert.NoError(t, err) @@ -96,9 +96,10 @@ func TestSyncStatefulSetsAnnotations(t *testing.T) { t.Errorf("%s: match between current and desired statefulsets albeit differences: %#v", testName, cmp) } - // now sync statefulset - the diff should trigger a update + // now sync statefulset - the diff will trigger a replacement of the statefulset cluster.syncStatefulSet() + // compare again after the SYNC - must be identical to the desired state cmp = cluster.compareStatefulSetWith(desiredSts) if !cmp.match { t.Errorf("%s: current and desired statefulsets are not matching %#v", testName, cmp)