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
This commit is contained in:
parent
14d965722e
commit
80fab23e04
|
@ -8,7 +8,6 @@ import (
|
||||||
|
|
||||||
"github.com/hashicorp/terraform/backend"
|
"github.com/hashicorp/terraform/backend"
|
||||||
"github.com/hashicorp/terraform/backend/remote-state"
|
"github.com/hashicorp/terraform/backend/remote-state"
|
||||||
"github.com/hashicorp/terraform/helper/acctest"
|
|
||||||
"github.com/hashicorp/terraform/state/remote"
|
"github.com/hashicorp/terraform/state/remote"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -17,11 +16,15 @@ func TestRemoteClient_impl(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestRemoteClient(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
|
// Get the backend
|
||||||
b := backend.TestBackendConfig(t, New(), map[string]interface{}{
|
b := backend.TestBackendConfig(t, New(), map[string]interface{}{
|
||||||
"address": "demo.consul.io:80",
|
"address": addr,
|
||||||
"path": fmt.Sprintf("tf-unit/%s", time.Now().String()),
|
"path": fmt.Sprintf("tf-unit/%s", time.Now().String()),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue