From 3449fa1bc34ef2e2a87cc0bc24c1bc81a7333f81 Mon Sep 17 00:00:00 2001 From: Sean Chittenden Date: Sat, 23 Apr 2016 19:54:46 -0700 Subject: [PATCH] Consistently skip Consul checks Hide all Consul checks behind `CONSUL_HTTP_ADDR` env vs `CONSUL_ADDR` which is non-standard. --- physical/consul_test.go | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/physical/consul_test.go b/physical/consul_test.go index 2c9e77d89..a25bd1129 100644 --- a/physical/consul_test.go +++ b/physical/consul_test.go @@ -275,6 +275,11 @@ func TestConsul_UpdateAdvertiseAddr(t *testing.T) { } func TestConsul_AdvertiseActive(t *testing.T) { + addr := os.Getenv("CONSUL_HTTP_ADDR") + if addr == "" { + t.Skipf("No consul process running, skipping test") + } + c := testConsulBackend(t) if c.active != false { @@ -303,6 +308,11 @@ func TestConsul_AdvertiseActive(t *testing.T) { } func TestConsul_AdvertiseSealed(t *testing.T) { + addr := os.Getenv("CONSUL_HTTP_ADDR") + if addr == "" { + t.Skipf("No consul process running, skipping test") + } + c := testConsulBackend(t) if c.sealed != false { @@ -396,9 +406,9 @@ func TestConsul_serviceID(t *testing.T) { } func TestConsulBackend(t *testing.T) { - addr := os.Getenv("CONSUL_ADDR") + addr := os.Getenv("CONSUL_HTTP_ADDR") if addr == "" { - t.SkipNow() + t.Skipf("No consul process running, skipping test") } conf := api.DefaultConfig() @@ -427,9 +437,9 @@ func TestConsulBackend(t *testing.T) { } func TestConsulHABackend(t *testing.T) { - addr := os.Getenv("CONSUL_ADDR") + addr := os.Getenv("CONSUL_HTTP_ADDR") if addr == "" { - t.SkipNow() + t.Skipf("No consul process running, skipping test") } conf := api.DefaultConfig()