Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/cloudwatch: Add ErrorCheck #18261

Merged
merged 3 commits into from
Mar 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions aws/resource_aws_cloudwatch_composite_alarm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ func TestAccAwsCloudWatchCompositeAlarm_basic(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsCloudWatchCompositeAlarmDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -122,6 +123,7 @@ func TestAccAwsCloudWatchCompositeAlarm_disappears(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsCloudWatchCompositeAlarmDestroy,
Steps: []resource.TestStep{
Expand All @@ -143,6 +145,7 @@ func TestAccAwsCloudWatchCompositeAlarm_actionsEnabled(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsCloudWatchCompositeAlarmDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -180,6 +183,7 @@ func TestAccAwsCloudWatchCompositeAlarm_alarmActions(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsCloudWatchCompositeAlarmDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -229,6 +233,7 @@ func TestAccAwsCloudWatchCompositeAlarm_description(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsCloudWatchCompositeAlarmDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -266,6 +271,7 @@ func TestAccAwsCloudWatchCompositeAlarm_insufficientDataActions(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsCloudWatchCompositeAlarmDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -315,6 +321,7 @@ func TestAccAwsCloudWatchCompositeAlarm_okActions(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsCloudWatchCompositeAlarmDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -364,6 +371,7 @@ func TestAccAwsCloudWatchCompositeAlarm_allActions(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsCloudWatchCompositeAlarmDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -405,6 +413,7 @@ func TestAccAwsCloudWatchCompositeAlarm_updateAlarmRule(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAwsCloudWatchCompositeAlarmDestroy,
Steps: []resource.TestStep{
Expand Down
3 changes: 3 additions & 0 deletions aws/resource_aws_cloudwatch_dashboard_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ func TestAccAWSCloudWatchDashboard_basic(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSCloudWatchDashboardDestroy,
Steps: []resource.TestStep{
Expand All @@ -47,6 +48,7 @@ func TestAccAWSCloudWatchDashboard_update(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSCloudWatchDashboardDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -82,6 +84,7 @@ func TestAccAWSCloudWatchDashboard_updateName(t *testing.T) {
rInt2 := acctest.RandInt()
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSCloudWatchDashboardDestroy,
Steps: []resource.TestStep{
Expand Down
12 changes: 12 additions & 0 deletions aws/resource_aws_cloudwatch_metric_alarm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func TestAccAWSCloudWatchMetricAlarm_basic(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSCloudWatchMetricAlarmDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -49,6 +50,7 @@ func TestAccAWSCloudWatchMetricAlarm_AlarmActions_EC2Automate(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSCloudWatchMetricAlarmDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -96,6 +98,7 @@ func TestAccAWSCloudWatchMetricAlarm_AlarmActions_SNSTopic(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSCloudWatchMetricAlarmDestroy,
Steps: []resource.TestStep{
Expand All @@ -122,6 +125,7 @@ func TestAccAWSCloudWatchMetricAlarm_AlarmActions_SWFAction(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSCloudWatchMetricAlarmDestroy,
Steps: []resource.TestStep{
Expand All @@ -148,6 +152,7 @@ func TestAccAWSCloudWatchMetricAlarm_datapointsToAlarm(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSCloudWatchMetricAlarmDestroy,
Steps: []resource.TestStep{
Expand All @@ -169,6 +174,7 @@ func TestAccAWSCloudWatchMetricAlarm_treatMissingData(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSCloudWatchMetricAlarmDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -197,6 +203,7 @@ func TestAccAWSCloudWatchMetricAlarm_evaluateLowSampleCountPercentiles(t *testin

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSCloudWatchMetricAlarmDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -225,6 +232,7 @@ func TestAccAWSCloudWatchMetricAlarm_extendedStatistic(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSCloudWatchMetricAlarmDestroy,
Steps: []resource.TestStep{
Expand All @@ -246,6 +254,7 @@ func TestAccAWSCloudWatchMetricAlarm_expression(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSCloudWatchMetricAlarmDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -301,6 +310,7 @@ func TestAccAWSCloudWatchMetricAlarm_missingStatistic(t *testing.T) {
rName := acctest.RandomWithPrefix("tf-acc-test")
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSCloudWatchMetricAlarmDestroy,
Steps: []resource.TestStep{
Expand All @@ -319,6 +329,7 @@ func TestAccAWSCloudWatchMetricAlarm_tags(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSCloudWatchMetricAlarmDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -363,6 +374,7 @@ func TestAccAWSCloudWatchMetricAlarm_disappears(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, cloudwatch.EndpointsID),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSCloudWatchMetricAlarmDestroy,
Steps: []resource.TestStep{
Expand Down