Skip to content

Commit d203dcf

Browse files
author
Lee Johnson
committed
simplifying tests by removing tests and test data that is no longer needed
1 parent c62f6a8 commit d203dcf

2 files changed

Lines changed: 0 additions & 88 deletions

File tree

builtin/providers/statuscake/resource_statuscaketest.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,6 @@ func resourceStatusCakeTest() *schema.Resource {
5858
Type: schema.TypeInt,
5959
Computed: true,
6060
},
61-
"contact_id": &schema.Schema{
62-
Type: schema.TypeInt,
63-
Optional: true,
64-
},
6561
},
6662
}
6763
}
@@ -74,7 +70,6 @@ func CreateTest(d *schema.ResourceData, meta interface{}) error {
7470
WebsiteURL: d.Get("website_url").(string),
7571
TestType: d.Get("test_type").(string),
7672
CheckRate: d.Get("check_rate").(int),
77-
ContactID: d.Get("contact_id").(int),
7873
}
7974

8075
log.Printf("[DEBUG] Creating new StatusCake Test: %s", d.Get("website_name").(string))

builtin/providers/statuscake/resource_statuscaketest_test.go

Lines changed: 0 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package statuscake
22

33
import (
44
"fmt"
5-
"os"
65
"strconv"
76
"testing"
87

@@ -11,19 +10,6 @@ import (
1110
"github.com/hashicorp/terraform/terraform"
1211
)
1312

14-
// check to ensure that contact group id is provided before running
15-
// tests on it.
16-
func testAccContactGroupPreCheck(t *testing.T, testAlt bool) {
17-
if v := os.Getenv("CONTACT_GROUP"); v == "" {
18-
t.Fatal("CONTACT_GROUP must be set for contact group acceptance tests")
19-
}
20-
if testAlt {
21-
if v := os.Getenv("ALT_CONTACT_GROUP"); v == "" {
22-
t.Fatal("ALT_CONTACT_GROUP must be set for contact group acceptance tests")
23-
}
24-
}
25-
}
26-
2713
func TestAccStatusCake_basic(t *testing.T) {
2814
var test statuscake.Test
2915

@@ -70,57 +56,6 @@ func TestAccStatusCake_withUpdate(t *testing.T) {
7056
})
7157
}
7258

73-
func TestAccStatusCake_contactGroup_basic(t *testing.T) {
74-
var test statuscake.Test
75-
76-
resource.Test(t, resource.TestCase{
77-
PreCheck: func() {
78-
testAccPreCheck(t)
79-
testAccContactGroupPreCheck(t, false)
80-
},
81-
Providers: testAccProviders,
82-
CheckDestroy: testAccTestCheckDestroy(&test),
83-
Steps: []resource.TestStep{
84-
resource.TestStep{
85-
Config: testAccTestConfig_contactGroup,
86-
Check: resource.ComposeTestCheckFunc(
87-
testAccTestCheckExists("statuscake_test.google", &test),
88-
),
89-
},
90-
},
91-
})
92-
}
93-
94-
func TestAccStatusCake_contactGroup_withUpdate(t *testing.T) {
95-
var test statuscake.Test
96-
var altContactGroup = os.Getenv("ALT_CONTACT_GROUP")
97-
98-
resource.Test(t, resource.TestCase{
99-
PreCheck: func() {
100-
testAccPreCheck(t)
101-
testAccContactGroupPreCheck(t, true)
102-
},
103-
Providers: testAccProviders,
104-
CheckDestroy: testAccTestCheckDestroy(&test),
105-
Steps: []resource.TestStep{
106-
resource.TestStep{
107-
Config: testAccTestConfig_contactGroup,
108-
Check: resource.ComposeTestCheckFunc(
109-
testAccTestCheckExists("statuscake_test.google", &test),
110-
),
111-
},
112-
// make sure to creat
113-
resource.TestStep{
114-
Config: testAccTestConfig_contactGroup_update,
115-
Check: resource.ComposeTestCheckFunc(
116-
testAccTestCheckExists("statuscake_test.google", &test),
117-
resource.TestCheckResourceAttr("statuscake_test.google", "contact_id", altContactGroup),
118-
),
119-
},
120-
},
121-
})
122-
}
123-
12459
func testAccTestCheckExists(rn string, test *statuscake.Test) resource.TestCheckFunc {
12560
return func(s *terraform.State) error {
12661
rs, ok := s.RootModule().Resources[rn]
@@ -181,21 +116,3 @@ resource "statuscake_test" "google" {
181116
contact_id = 23456
182117
}
183118
`
184-
185-
var testAccTestConfig_contactGroup string = `` +
186-
`resource "statuscake_test" "google" {
187-
website_name = "google.com"
188-
website_url = "www.google.com"
189-
test_type = "HTTP"
190-
check_rate = 300
191-
contact_id = ` + os.Getenv("CONTACT_GROUP") + `
192-
}`
193-
194-
var testAccTestConfig_contactGroup_update string = `` +
195-
`resource "statuscake_test" "google" {
196-
website_name = "google.com"
197-
website_url = "www.google.com"
198-
test_type = "HTTP"
199-
check_rate = 300
200-
contact_id = ` + os.Getenv("ALT_CONTACT_GROUP") + `
201-
}`

0 commit comments

Comments
 (0)