Skip to content

Commit

Permalink
Suppress GovCloud acceptance testing errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
ewbankkit committed Jun 7, 2021
1 parent 79b9c0a commit 0564773
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions aws/resource_aws_ecs_task_definition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import (
)

func init() {
RegisterServiceErrorCheckFunc(ecs.EndpointsID, testAccErrorCheckSkipECS)

resource.AddTestSweepers("aws_ecs_task_definition", &resource.Sweeper{
Name: "aws_ecs_task_definition",
F: testSweepEcsTaskDefinitions,
Expand Down Expand Up @@ -65,6 +67,12 @@ func testSweepEcsTaskDefinitions(region string) error {
return sweeperErrs.ErrorOrNil()
}

func testAccErrorCheckSkipECS(t *testing.T) resource.ErrorCheckFunc {
return testAccErrorCheckSkipMessagesContaining(t,
"Unsupported field 'inferenceAccelerators'",
)
}

func TestAccAWSEcsTaskDefinition_basic(t *testing.T) {
var def ecs.TaskDefinition

Expand Down Expand Up @@ -357,6 +365,10 @@ func TestAccAWSEcsTaskDefinition_withFsxWinFileSystem(t *testing.T) {
rName := acctest.RandomWithPrefix("tf-acc-test")
resourceName := "aws_ecs_task_definition.test"

if testAccGetPartition() == "aws-us-gov" {
t.Skip("Amazon FSx for Windows File Server volumes for ECS tasks are not supported in GovCloud partition")
}

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ecs.EndpointsID),
Expand Down

0 comments on commit 0564773

Please sign in to comment.