From 1c1d46e1ac6c079bb345061a277301fcb3b435e6 Mon Sep 17 00:00:00 2001 From: Asim Aslam Date: Thu, 9 Nov 2017 14:16:35 +0000 Subject: [PATCH] Add some test logging --- registry/consul_registry_test.go | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/registry/consul_registry_test.go b/registry/consul_registry_test.go index 7441a22c..fc51072a 100644 --- a/registry/consul_registry_test.go +++ b/registry/consul_registry_test.go @@ -104,7 +104,11 @@ func TestConsul_GetService_WithHealthyServiceNodes(t *testing.T) { }) defer cl() - svc, _ := cr.GetService("service-name") + svc, err := cr.GetService("service-name") + if err != nil { + t.Fatal("Unexpected error", err) + } + if exp, act := 1, len(svc); exp != act { t.Fatalf("Expected len of svc to be `%d`, got `%d`.", exp, act) } @@ -140,7 +144,11 @@ func TestConsul_GetService_WithUnhealthyServiceNode(t *testing.T) { }) defer cl() - svc, _ := cr.GetService("service-name") + svc, err := cr.GetService("service-name") + if err != nil { + t.Fatal("Unexpected error", err) + } + if exp, act := 1, len(svc); exp != act { t.Fatalf("Expected len of svc to be `%d`, got `%d`.", exp, act) } @@ -176,7 +184,11 @@ func TestConsul_GetService_WithUnhealthyServiceNodes(t *testing.T) { }) defer cl() - svc, _ := cr.GetService("service-name") + svc, err := cr.GetService("service-name") + if err != nil { + t.Fatal("Unexpected error", err) + } + if exp, act := 1, len(svc); exp != act { t.Fatalf("Expected len of svc to be `%d`, got `%d`.", exp, act) }