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/provider: Add missing ErrorCheck to TestCase #18306

Merged
merged 2 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
2 changes: 2 additions & 0 deletions aws/resource_aws_iam_group_policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ func TestAccAWSIAMGroupPolicy_namePrefix(t *testing.T) {
rInt := acctest.RandInt()
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, iam.EndpointsID),
IDRefreshName: "aws_iam_group_policy.test",
Providers: testAccProviders,
CheckDestroy: testAccCheckIAMGroupPolicyDestroy,
Expand Down Expand Up @@ -127,6 +128,7 @@ func TestAccAWSIAMGroupPolicy_generatedName(t *testing.T) {
rInt := acctest.RandInt()
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, iam.EndpointsID),
IDRefreshName: "aws_iam_group_policy.test",
Providers: testAccProviders,
CheckDestroy: testAccCheckIAMGroupPolicyDestroy,
Expand Down
1 change: 1 addition & 0 deletions aws/resource_aws_iam_instance_profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ func TestAccAWSIAMInstanceProfile_namePrefix(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, iam.EndpointsID),
IDRefreshName: resourceName,
IDRefreshIgnore: []string{"name_prefix"},
Providers: testAccProviders,
Expand Down
2 changes: 2 additions & 0 deletions aws/resource_aws_iam_role_policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ func TestAccAWSIAMRolePolicy_namePrefix(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, iam.EndpointsID),
IDRefreshName: resourceName,
Providers: testAccProviders,
CheckDestroy: testAccCheckIAMRolePolicyDestroy,
Expand Down Expand Up @@ -146,6 +147,7 @@ func TestAccAWSIAMRolePolicy_generatedName(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, iam.EndpointsID),
IDRefreshName: resourceName,
Providers: testAccProviders,
CheckDestroy: testAccCheckIAMRolePolicyDestroy,
Expand Down
1 change: 1 addition & 0 deletions aws/resource_aws_iam_role_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ func TestAccAWSIAMRole_namePrefix(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, iam.EndpointsID),
IDRefreshName: resourceName,
IDRefreshIgnore: []string{"name_prefix"},
Providers: testAccProviders,
Expand Down
2 changes: 2 additions & 0 deletions aws/resource_aws_iam_user_policy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ func TestAccAWSIAMUserPolicy_namePrefix(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, iam.EndpointsID),
IDRefreshName: policyResourceName,
Providers: testAccProviders,
CheckDestroy: testAccCheckIAMUserPolicyDestroy,
Expand Down Expand Up @@ -137,6 +138,7 @@ func TestAccAWSIAMUserPolicy_generatedName(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, iam.EndpointsID),
IDRefreshName: policyResourceName,
Providers: testAccProviders,
CheckDestroy: testAccCheckIAMUserPolicyDestroy,
Expand Down
24 changes: 24 additions & 0 deletions aws/resource_aws_instance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ func TestAccAWSInstance_basic(t *testing.T) {
testAccPreCheck(t)
testAccPreCheckEc2ClassicOrHasDefaultVpcWithDefaultSubnets(t)
},
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
Providers: testAccProviders,
CheckDestroy: testAccCheckInstanceDestroy,
Expand Down Expand Up @@ -269,6 +270,7 @@ func TestAccAWSInstance_atLeastOneOtherEbsVolume(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
Providers: testAccProviders,
CheckDestroy: testAccCheckInstanceDestroy,
Expand Down Expand Up @@ -398,6 +400,7 @@ func TestAccAWSInstance_userDataBase64(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
Providers: testAccProviders,
CheckDestroy: testAccCheckInstanceDestroy,
Expand Down Expand Up @@ -442,6 +445,7 @@ func TestAccAWSInstance_GP2IopsDevice(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
IDRefreshIgnore: []string{"ephemeral_block_device", "user_data"},
Providers: testAccProviders,
Expand Down Expand Up @@ -533,6 +537,7 @@ func TestAccAWSInstance_blockDevices(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
IDRefreshIgnore: []string{"ephemeral_block_device"},
Providers: testAccProviders,
Expand Down Expand Up @@ -609,6 +614,7 @@ func TestAccAWSInstance_rootInstanceStore(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
Providers: testAccProviders,
CheckDestroy: testAccCheckInstanceDestroy,
Expand Down Expand Up @@ -663,6 +669,7 @@ func TestAccAWSInstance_noAMIEphemeralDevices(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
IDRefreshIgnore: []string{"ephemeral_block_device"},
Providers: testAccProviders,
Expand Down Expand Up @@ -719,6 +726,7 @@ func TestAccAWSInstance_sourceDestCheck(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
Providers: testAccProviders,
CheckDestroy: testAccCheckInstanceDestroy,
Expand Down Expand Up @@ -778,6 +786,7 @@ func TestAccAWSInstance_disableApiTermination(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
Providers: testAccProviders,
CheckDestroy: testAccCheckInstanceDestroy,
Expand Down Expand Up @@ -812,6 +821,7 @@ func TestAccAWSInstance_dedicatedInstance(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
IDRefreshIgnore: []string{"associate_public_ip_address"},
Providers: testAccProviders,
Expand Down Expand Up @@ -842,6 +852,7 @@ func TestAccAWSInstance_outpost(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSOutpostsOutposts(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
IDRefreshIgnore: []string{"associate_public_ip_address"},
Providers: testAccProviders,
Expand Down Expand Up @@ -870,6 +881,7 @@ func TestAccAWSInstance_placementGroup(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
IDRefreshIgnore: []string{"associate_public_ip_address"},
Providers: testAccProviders,
Expand Down Expand Up @@ -969,6 +981,7 @@ func TestAccAWSInstance_NetworkInstanceSecurityGroups(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
IDRefreshIgnore: []string{"associate_public_ip_address"},
Providers: testAccProviders,
Expand Down Expand Up @@ -996,6 +1009,7 @@ func TestAccAWSInstance_NetworkInstanceRemovingAllSecurityGroups(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
Providers: testAccProviders,
CheckDestroy: testAccCheckInstanceDestroy,
Expand Down Expand Up @@ -1033,6 +1047,7 @@ func TestAccAWSInstance_NetworkInstanceVPCSecurityGroupIDs(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
Providers: testAccProviders,
CheckDestroy: testAccCheckInstanceDestroy,
Expand Down Expand Up @@ -1264,6 +1279,7 @@ func TestAccAWSInstance_instanceProfileChange(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
Providers: testAccProviders,
CheckDestroy: testAccCheckInstanceDestroy,
Expand Down Expand Up @@ -1320,6 +1336,7 @@ func TestAccAWSInstance_withIamInstanceProfile(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
Providers: testAccProviders,
CheckDestroy: testAccCheckInstanceDestroy,
Expand Down Expand Up @@ -1384,6 +1401,7 @@ func TestAccAWSInstance_privateIP(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
Providers: testAccProviders,
CheckDestroy: testAccCheckInstanceDestroy,
Expand Down Expand Up @@ -1421,6 +1439,7 @@ func TestAccAWSInstance_associatePublicIPAndPrivateIP(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
IDRefreshIgnore: []string{"associate_public_ip_address"},
Providers: testAccProviders,
Expand Down Expand Up @@ -1461,6 +1480,7 @@ func TestAccAWSInstance_Empty_PrivateIP(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
Providers: testAccProviders,
CheckDestroy: testAccCheckInstanceDestroy,
Expand Down Expand Up @@ -1503,6 +1523,7 @@ func TestAccAWSInstance_keyPairCheck(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
IDRefreshIgnore: []string{"source_dest_check"},
Providers: testAccProviders,
Expand Down Expand Up @@ -1563,6 +1584,7 @@ func TestAccAWSInstance_forceNewAndTagsDrift(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
Providers: testAccProviders,
CheckDestroy: testAccCheckInstanceDestroy,
Expand Down Expand Up @@ -3326,6 +3348,7 @@ func TestAccAWSInstance_metadataOptions(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
Providers: testAccProviders,
CheckDestroy: testAccCheckInstanceDestroy,
Expand Down Expand Up @@ -3923,6 +3946,7 @@ func TestAccAWSInstance_GP3RootBlockDevice(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
IDRefreshIgnore: []string{"ephemeral_block_device", "user_data"},
Providers: testAccProviders,
Expand Down
3 changes: 3 additions & 0 deletions aws/resource_aws_internet_gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ func TestAccAWSInternetGateway_basic(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
Providers: testAccProviders,
CheckDestroy: testAccCheckInternetGatewayDestroy,
Expand Down Expand Up @@ -188,6 +189,7 @@ func TestAccAWSInternetGateway_delete(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
Providers: testAccProviders,
CheckDestroy: testAccCheckInternetGatewayDestroy,
Expand All @@ -212,6 +214,7 @@ func TestAccAWSInternetGateway_tags(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
Providers: testAccProviders,
CheckDestroy: testAccCheckInternetGatewayDestroy,
Expand Down
1 change: 1 addition & 0 deletions aws/resource_aws_key_pair_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ func TestAccAWSKeyPair_namePrefix(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
IDRefreshIgnore: []string{"key_name_prefix"},
Providers: testAccProviders,
Expand Down
1 change: 1 addition & 0 deletions aws/resource_aws_nat_gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ func TestAccAWSNatGateway_basic(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
Providers: testAccProviders,
CheckDestroy: testAccCheckNatGatewayDestroy,
Expand Down
11 changes: 11 additions & 0 deletions aws/resource_aws_network_acl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ func TestAccAWSNetworkAcl_EgressAndIngressRules(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSNetworkAclDestroy,
Expand Down Expand Up @@ -351,6 +352,7 @@ func TestAccAWSNetworkAcl_OnlyIngressRules_basic(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSNetworkAclDestroy,
Expand Down Expand Up @@ -385,6 +387,7 @@ func TestAccAWSNetworkAcl_OnlyIngressRules_update(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSNetworkAclDestroy,
Expand Down Expand Up @@ -440,6 +443,7 @@ func TestAccAWSNetworkAcl_CaseSensitivityNoChanges(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSNetworkAclDestroy,
Expand All @@ -465,6 +469,7 @@ func TestAccAWSNetworkAcl_OnlyEgressRules(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSNetworkAclDestroy,
Expand Down Expand Up @@ -493,6 +498,7 @@ func TestAccAWSNetworkAcl_SubnetChange(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSNetworkAclDestroy,
Expand Down Expand Up @@ -538,6 +544,7 @@ func TestAccAWSNetworkAcl_Subnets(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSNetworkAclDestroy,
Expand Down Expand Up @@ -586,6 +593,7 @@ func TestAccAWSNetworkAcl_SubnetsDelete(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSNetworkAclDestroy,
Expand Down Expand Up @@ -622,6 +630,7 @@ func TestAccAWSNetworkAcl_ipv6Rules(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSNetworkAclDestroy,
Expand Down Expand Up @@ -678,6 +687,7 @@ func TestAccAWSNetworkAcl_ipv6VpcRules(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSNetworkAclDestroy,
Expand Down Expand Up @@ -708,6 +718,7 @@ func TestAccAWSNetworkAcl_espProtocol(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: resourceName,
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSNetworkAclDestroy,
Expand Down
1 change: 1 addition & 0 deletions aws/resource_aws_network_interface_attachment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ func TestAccAWSNetworkInterfaceAttachment_basic(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ErrorCheck: testAccErrorCheck(t, ec2.EndpointsID),
IDRefreshName: "aws_network_interface.bar",
Providers: testAccProviders,
CheckDestroy: testAccCheckAWSENIDestroy,
Expand Down
Loading