From 52d93ddda2a9be2f9207c7f572e904173d3642e5 Mon Sep 17 00:00:00 2001 From: Yuval Kohavi Date: Thu, 16 May 2019 13:08:53 -0400 Subject: [PATCH] fix router tests --- pkg/router/gloo_test.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkg/router/gloo_test.go b/pkg/router/gloo_test.go index bcce4d20..408be347 100644 --- a/pkg/router/gloo_test.go +++ b/pkg/router/gloo_test.go @@ -35,8 +35,15 @@ func TestGlooRouter_Sync(t *testing.T) { t.Fatal(err.Error()) } dests := ug.GetDestinations() - if len(dests) != 1 { - t.Errorf("Got RoutingRule Destinations %v wanted %v", len(dests), 1) + if len(dests) != 2 { + t.Errorf("Got Destinations %v wanted %v", len(dests), 2) + } + + if dests[0].Weight != 100 { + t.Errorf("Primary weight should is %v wanted 100", dests[0].Weight) + } + if dests[1].Weight != 0 { + t.Errorf("Canary weight should is %v wanted 0", dests[0].Weight) } }