Skip to content

Commit 3e43eb5

Browse files
committed
provider/consul: Fixing test harness
1 parent dc3178e commit 3e43eb5

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

builtin/providers/consul/resource_consul_keys_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ func testAccCheckConsulKeysValue(n, attr, val string) resource.TestCheckFunc {
7878

7979
const testAccConsulKeysConfig = `
8080
resource "consul_keys" "app" {
81-
datacenter = "nyc1"
81+
datacenter = "nyc3"
8282
key {
8383
name = "time"
8484
path = "global/time"

builtin/providers/consul/resource_provider_test.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package consul
33
import (
44
"testing"
55

6+
"github.com/armon/consul-api"
67
"github.com/hashicorp/terraform/config"
78
"github.com/hashicorp/terraform/helper/schema"
89
"github.com/hashicorp/terraform/terraform"
@@ -16,6 +17,13 @@ func init() {
1617
testAccProviders = map[string]terraform.ResourceProvider{
1718
"consul": testAccProvider,
1819
}
20+
21+
// Use the demo address for the acceptance tests
22+
testAccProvider.ConfigureFunc = func(d *schema.ResourceData) (interface{}, error) {
23+
conf := consulapi.DefaultConfig()
24+
conf.Address = "demo.consul.io:80"
25+
return consulapi.NewClient(conf)
26+
}
1927
}
2028

2129
func TestResourceProvider(t *testing.T) {
@@ -33,7 +41,7 @@ func TestResourceProvider_Configure(t *testing.T) {
3341

3442
raw := map[string]interface{}{
3543
"address": "demo.consul.io:80",
36-
"datacenter": "nyc1",
44+
"datacenter": "nyc3",
3745
}
3846

3947
rawConfig, err := config.NewRawConfig(raw)

0 commit comments

Comments
 (0)