Skip to content

Commit

Permalink
Merge pull request #220 from heimweh/ah/sweeper
Browse files Browse the repository at this point in the history
testing: update sweepers
  • Loading branch information
Scott McAllister authored May 12, 2020
2 parents 8b4e533 + 04a729f commit 5c4db76
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 3 additions & 6 deletions pagerduty/resource_pagerduty_event_rule_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package pagerduty
import (
"fmt"
"log"
"strings"
"testing"

"github.com/hashicorp/terraform-plugin-sdk/helper/acctest"
Expand Down Expand Up @@ -39,11 +38,9 @@ func testSweepEventRule(region string) error {
}

for _, rule := range resp.EventRules {
if strings.HasPrefix(rule.ID, "test") || strings.HasPrefix(rule.ID, "tf-") {
log.Printf("Destroying event rule %s", rule.ID)
if _, err := client.EventRules.Delete(rule.ID); err != nil {
return err
}
log.Printf("Destroying event rule %s", rule.ID)
if _, err := client.EventRules.Delete(rule.ID); err != nil {
log.Printf("[ERROR] Failed to delete event rule: %s", err)
}
}

Expand Down
2 changes: 1 addition & 1 deletion pagerduty/resource_pagerduty_user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func testSweepUser(region string) error {
}

for _, user := range resp.Users {
if strings.HasPrefix(user.Name, "test") || strings.HasPrefix(user.Name, "tf-") {
if strings.HasPrefix(user.Name, "test") || strings.HasPrefix(user.Name, "tf") {
log.Printf("Destroying user %s (%s)", user.Name, user.ID)
if _, err := client.Users.Delete(user.ID); err != nil {
return err
Expand Down

0 comments on commit 5c4db76

Please sign in to comment.