Skip to content

Commit

Permalink
Merge pull request #17473 from hashicorp/td-emr-managed-scaling-polic…
Browse files Browse the repository at this point in the history
…y-gov-cloud
  • Loading branch information
anGie44 authored Feb 5, 2021
2 parents c699ff9 + 5cce359 commit 9c9de45
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions aws/resource_aws_emr_managed_scaling_policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ func TestAccAwsEmrManagedScalingPolicy_basic(t *testing.T) {
rName := acctest.RandomWithPrefix("tf-acc-test")
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheckSkipEmrManagedScalingPolicy(t),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSEmrManagedScalingPolicyDestroy,

Expand All @@ -41,6 +42,7 @@ func TestAccAwsEmrManagedScalingPolicy_ComputeLimits_MaximumCoreCapacityUnits(t
rName := acctest.RandomWithPrefix("tf-acc-test")
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheckSkipEmrManagedScalingPolicy(t),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSEmrManagedScalingPolicyDestroy,

Expand All @@ -65,6 +67,7 @@ func TestAccAwsEmrManagedScalingPolicy_ComputeLimits_MaximumOndemandCapacityUnit
rName := acctest.RandomWithPrefix("tf-acc-test")
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheckSkipEmrManagedScalingPolicy(t),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSEmrManagedScalingPolicyDestroy,

Expand All @@ -89,6 +92,7 @@ func TestAccAwsEmrManagedScalingPolicy_disappears(t *testing.T) {
rName := acctest.RandomWithPrefix("tf-acc-test")
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheckSkipEmrManagedScalingPolicy(t),
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSEmrManagedScalingPolicyDestroy,
Steps: []resource.TestStep{
Expand All @@ -104,6 +108,13 @@ func TestAccAwsEmrManagedScalingPolicy_disappears(t *testing.T) {
})
}

// testAccErrorCheckSkipEmrManagedScalingPolicy skips tests that have error messages indicating unsupported features
func testAccErrorCheckSkipEmrManagedScalingPolicy(t *testing.T) resource.ErrorCheckFunc {
return testAccErrorCheckSkipMessagesContaining(t,
"Managed scaling is not available",
)
}

func testAccAWSEmrManagedScalingPolicy_basic(r string) string {
return fmt.Sprintf(testAccAWSEmrManagedScalingPolicyBase+`
resource "aws_emr_managed_scaling_policy" "testpolicy" {
Expand Down

0 comments on commit 9c9de45

Please sign in to comment.