Skip to content

Commit 7a94502

Browse files
committed
Fix broken test
1 parent af2f273 commit 7a94502

File tree

1 file changed

+3
-23
lines changed

1 file changed

+3
-23
lines changed

sumologic/resource_sumologic_monitors_library_monitor_test.go

Lines changed: 3 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ func TestAccSumologicMonitorsLibraryMonitor_schemaTriggerValidations(t *testing.
118118
threshold_type = "foo"
119119
}
120120
}`
121-
expectedError := regexp.MustCompile(".*expected triggers.0.threshold_type to be one of \\[LessThan LessThanOrEqual GreaterThan GreaterThanOrEqual\\], got foo.*")
121+
expectedError := regexp.MustCompile(`.*expected triggers.0.threshold_type to be one of \["LessThan" "LessThanOrEqual" "GreaterThan" "GreaterThanOrEqual"\], got foo.*`)
122122
resource.Test(t, resource.TestCase{
123123
Providers: testAccProviders,
124124
CheckDestroy: testAccCheckMonitorsLibraryMonitorDestroy(),
@@ -145,7 +145,7 @@ func TestAccSumologicMonitorsLibraryMonitor_schemaTriggerConditionValidations(t
145145
Steps: []resource.TestStep{
146146
{
147147
Config: monitorConfig(testName),
148-
ExpectError: regexp.MustCompile("config is invalid"),
148+
ExpectError: regexp.MustCompile("Missing required argument"),
149149
},
150150
},
151151
})
@@ -1540,26 +1540,6 @@ var allExampleMonitors = []func(testName string) string{
15401540
exampleMetricsAnomalyMonitor,
15411541
}
15421542

1543-
func testAccSumologicMonitorsLibraryMonitorWithInvalidTriggerCondition(testName string, triggerCondition string) string {
1544-
return fmt.Sprintf(`
1545-
resource "sumologic_monitor" "test" {
1546-
name = "terraform_test_monitor_%s"
1547-
description = "terraform_test_monitor_description"
1548-
type = "MonitorsLibraryMonitor"
1549-
is_disabled = false
1550-
content_type = "Monitor"
1551-
monitor_type = "Logs"
1552-
evaluation_delay = "60m"
1553-
queries {
1554-
row_id = "A"
1555-
query = "_sourceCategory=monitor-manager error"
1556-
}
1557-
trigger_conditions {
1558-
%s
1559-
}
1560-
}`, testName, triggerCondition)
1561-
}
1562-
15631543
func exampleLogsStaticTriggerCondition(triggerType string, threshold float64, thresholdType string) TriggerCondition {
15641544
return TriggerCondition{
15651545
TimeRange: "30m",
@@ -1705,7 +1685,7 @@ func genExpectedPermStmtsForMonitorUpdate(s *terraform.State, targetId string) (
17051685

17061686
func testAccCheckMonitorsLibraryMonitorFGPBackend(
17071687
name string,
1708-
t *testing.T,
1688+
_ *testing.T,
17091689
expectedFGPFunc func(*terraform.State, string) ([]CmfFgpPermStatement, error),
17101690
) resource.TestCheckFunc {
17111691

0 commit comments

Comments
 (0)