From 41481c1ca8b58cbe29710c1fc4858543c6784e3f Mon Sep 17 00:00:00 2001 From: Iaroslav Vorozhko Date: Thu, 13 May 2021 14:38:41 +0200 Subject: [PATCH] Adjusted tests to new behaviour on init and promotion Signed-off-by: Iaroslav Vorozhko --- pkg/router/ingress_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/router/ingress_test.go b/pkg/router/ingress_test.go index 81d24d27..f327406a 100644 --- a/pkg/router/ingress_test.go +++ b/pkg/router/ingress_test.go @@ -42,13 +42,15 @@ func TestIngressRouter_Reconcile(t *testing.T) { require.NoError(t, err) canaryAn := "custom.ingress.kubernetes.io/canary" + canaryWeightAn := "custom.ingress.kubernetes.io/canary-weight" canaryName := fmt.Sprintf("%s-canary", mocks.ingressCanary.Spec.IngressRef.Name) inCanary, err := router.kubeClient.NetworkingV1beta1().Ingresses("default").Get(context.TODO(), canaryName, metav1.GetOptions{}) require.NoError(t, err) // test initialisation - assert.Equal(t, "false", inCanary.Annotations[canaryAn]) + assert.Equal(t, "true", inCanary.Annotations[canaryAn]) + assert.Equal(t, "0", inCanary.Annotations[canaryWeightAn]) } func TestIngressRouter_GetSetRoutes(t *testing.T) { @@ -94,7 +96,8 @@ func TestIngressRouter_GetSetRoutes(t *testing.T) { require.NoError(t, err) // test promotion - assert.Equal(t, "false", inCanary.Annotations[canaryAn]) + assert.Equal(t, "true", inCanary.Annotations[canaryAn]) + assert.Equal(t, "0", inCanary.Annotations[canaryWeightAn]) } func TestIngressRouter_ABTest(t *testing.T) {