From 80fab23e04f2dc03f96c51746411ecb318d67af8 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Wed, 8 Feb 2017 10:51:51 -0500 Subject: [PATCH] Don't test consul using demo.consul.io We shoudn't require an external service for unit test. TODO: create some proper acceptance tests for consul --- backend/remote-state/consul/client_test.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/backend/remote-state/consul/client_test.go b/backend/remote-state/consul/client_test.go index 09d018fda8..bd52092ca5 100644 --- a/backend/remote-state/consul/client_test.go +++ b/backend/remote-state/consul/client_test.go @@ -8,7 +8,6 @@ import ( "github.com/hashicorp/terraform/backend" "github.com/hashicorp/terraform/backend/remote-state" - "github.com/hashicorp/terraform/helper/acctest" "github.com/hashicorp/terraform/state/remote" ) @@ -17,11 +16,15 @@ func TestRemoteClient_impl(t *testing.T) { } func TestRemoteClient(t *testing.T) { - acctest.RemoteTestPrecheck(t) + addr := os.Getenv("CONSUL_HTTP_ADDR") + if addr == "" { + t.Log("consul tests require CONSUL_HTTP_ADDR") + t.Skip() + } // Get the backend b := backend.TestBackendConfig(t, New(), map[string]interface{}{ - "address": "demo.consul.io:80", + "address": addr, "path": fmt.Sprintf("tf-unit/%s", time.Now().String()), })