aboutsummaryrefslogtreecommitdiffhomepage
path: root/statuscake/provider_test.go
diff options
context:
space:
mode:
authorMat Schaffer <mat@schaffer.me>2018-02-01 22:53:16 +0900
committerMat Schaffer <mat@schaffer.me>2018-02-01 22:53:16 +0900
commit7d96831373ec571cf0d7bcd930fd6118dc509fc2 (patch)
treef6c684360c490eb61e09b5f69fedc69a29fe38d1 /statuscake/provider_test.go
parent85e124eb0c7b262ff9c486abe9662f515f47fc5b (diff)
downloadterraform-provider-statuscake-7d96831373ec571cf0d7bcd930fd6118dc509fc2.tar.gz
terraform-provider-statuscake-7d96831373ec571cf0d7bcd930fd6118dc509fc2.tar.zst
terraform-provider-statuscake-7d96831373ec571cf0d7bcd930fd6118dc509fc2.zip
Move template interpolation deeper into acceptance tests
Since it was failing `make test` on travis. Must be a better way to go about this, but I couldn't come up with a better way that defaulting the value to avoid the error when running non-acceptance tests.
Diffstat (limited to 'statuscake/provider_test.go')
-rw-r--r--statuscake/provider_test.go15
1 files changed, 0 insertions, 15 deletions
diff --git a/statuscake/provider_test.go b/statuscake/provider_test.go
index 81d5888..83045d0 100644
--- a/statuscake/provider_test.go
+++ b/statuscake/provider_test.go
@@ -1,9 +1,7 @@
1package statuscake 1package statuscake
2 2
3import ( 3import (
4 "fmt"
5 "os" 4 "os"
6 "strconv"
7 "testing" 5 "testing"
8 6
9 "github.com/hashicorp/terraform/helper/schema" 7 "github.com/hashicorp/terraform/helper/schema"
@@ -12,25 +10,12 @@ import (
12 10
13var testAccProviders map[string]terraform.ResourceProvider 11var testAccProviders map[string]terraform.ResourceProvider
14var testAccProvider *schema.Provider 12var testAccProvider *schema.Provider
15var testContactGroupId int
16 13
17func init() { 14func init() {
18 testAccProvider = Provider().(*schema.Provider) 15 testAccProvider = Provider().(*schema.Provider)
19 testAccProviders = map[string]terraform.ResourceProvider{ 16 testAccProviders = map[string]terraform.ResourceProvider{
20 "statuscake": testAccProvider, 17 "statuscake": testAccProvider,
21 } 18 }
22
23 if v := os.Getenv("STATUSCAKE_TEST_CONTACT_GROUP_ID"); v == "" {
24 fmt.Println("STATUSCAKE_TEST_CONTACT_GROUP_ID must be set for acceptance tests")
25 os.Exit(1)
26 } else {
27 id, err := strconv.Atoi(v)
28 if err != nil {
29 fmt.Println("STATUSCAKE_TEST_CONTACT_GROUP_ID must be a valid int")
30 os.Exit(1)
31 }
32 testContactGroupId = id
33 }
34} 19}
35 20
36func TestProvider(t *testing.T) { 21func TestProvider(t *testing.T) {