Skip to content

Commit

Permalink
tests/provider: Standardize remaining alternate provider testing and …
Browse files Browse the repository at this point in the history
…refactor testAccProviderFactories for broad usage

Reference: #8316
Reference: #15737
Reference: #15791

This change set continues the work of #15877, bringing a consistent pattern for cross-region and cross-account testing and removing previously deprecated provider-level test functions. The `testAccProviderFactories` global variable is now generically for every test that only requires a single provider and prevents the previous issues where extraneous gRPC plugins were extraneously created (sometimes causing `ulimit` issues, but broadly a performance fix to remove them).

This also removes the temporary `testAccProviderFactoriesCur()` and `testAccProviderFactoriesEc2Classic()` functions, since anything only requiring a single provider can use `ProviderFactories: testAccProviderFactories` or `Providers: testAccProviders` (for now, its deprecated in the SDK and we'll be updating these everywhere to `ProviderFactories` anyways). This should mean that other existing EC2-Classic and special service region testing should not require changes to that particular field in future change sets that continue this effort.

After this, we are off to the races to remove the problematic environment variable handling causing issues across the provider acceptance testing.

Output from acceptance testing (CUR testing done in standalone account):

```
--- PASS: TestAccDataSourceAwsCurReportDefinition_additional (21.63s)
--- PASS: TestAccDataSourceAwsCurReportDefinition_basic (18.93s)

--- PASS: TestAccDataSourceAwsRoute53ResolverRule_basic (59.47s)
--- PASS: TestAccDataSourceAwsRoute53ResolverRule_ResolverEndpointIdWithTags (265.34s)

--- PASS: TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn (158.62s)
--- PASS: TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn_ConflictsWithCloudFrontDefaultCertificate (159.67s)

--- PASS: TestAccAWSCodePipeline_multiregion_basic (37.37s)
--- PASS: TestAccAWSCodePipeline_multiregion_Update (58.07s)
--- PASS: TestAccAWSCodePipeline_multiregion_ConvertSingleRegion (81.33s)

--- PASS: TestAccAwsCurReportDefinition_athena (18.30s)
--- PASS: TestAccAwsCurReportDefinition_basic (23.58s)
--- PASS: TestAccAwsCurReportDefinition_overwrite (18.10s)
--- PASS: TestAccAwsCurReportDefinition_parquet (18.67s)
--- PASS: TestAccAwsCurReportDefinition_refresh (21.62s)
--- PASS: TestAccAwsCurReportDefinition_textOrCsv (21.45s)

--- PASS: TestAccAWSDbSubnetGroupDataSource_basic (66.22s)
--- PASS: TestAccAWSDbSubnetGroupDataSource_nonexistent (3.06s)

--- PASS: TestAccAwsDxGatewayAssociation_allowedPrefixesVpnGatewayCrossAccount (1998.47s)
--- PASS: TestAccAwsDxGatewayAssociation_allowedPrefixesVpnGatewaySingleAccount (1957.89s)
--- PASS: TestAccAwsDxGatewayAssociation_basicTransitGatewayCrossAccount (865.40s)
--- PASS: TestAccAwsDxGatewayAssociation_basicTransitGatewaySingleAccount (1186.07s)
--- PASS: TestAccAwsDxGatewayAssociation_basicVpnGatewayCrossAccount (1530.51s)
--- PASS: TestAccAwsDxGatewayAssociation_basicVpnGatewaySingleAccount (1633.65s)
--- PASS: TestAccAwsDxGatewayAssociation_multiVpnGatewaysSingleAccount (1697.33s)
--- PASS: TestAccAwsDxGatewayAssociation_V0StateUpgrade (1187.97s)

--- PASS: TestAccAwsDxGatewayAssociationProposal_AllowedPrefixes (138.31s)
--- PASS: TestAccAwsDxGatewayAssociationProposal_basicTransitGateway (227.10s)
--- PASS: TestAccAwsDxGatewayAssociationProposal_basicVpnGateway (68.42s)
--- PASS: TestAccAwsDxGatewayAssociationProposal_disappears (64.49s)

--- SKIP: TestAccAwsDxHostedPrivateVirtualInterface_AccepterTags (0.00s)
--- SKIP: TestAccAwsDxHostedPrivateVirtualInterface_basic (0.00s)

--- SKIP: TestAccAwsDxHostedPublicVirtualInterface_AccepterTags (0.00s)
--- SKIP: TestAccAwsDxHostedPublicVirtualInterface_basic (0.00s)

--- PASS: TestAccAwsDxHostedTransitVirtualInterface_serial (0.00s)
    --- SKIP: TestAccAwsDxHostedTransitVirtualInterface_serial/accepterTags (0.00s)
    --- SKIP: TestAccAwsDxHostedTransitVirtualInterface_serial/basic (0.00s)

--- PASS: TestAccAWSDynamoDbGlobalTable_basic (84.93s)
--- PASS: TestAccAWSDynamoDbGlobalTable_multipleRegions (102.52s)

--- PASS: TestAccAWSEbsSnapshotCopy_withRegions (75.67s)

--- PASS: TestAccAwsRamResourceShareAccepter_basic (36.70s)

--- PASS: TestAccAWSRDSCluster_GlobalClusterIdentifier_PrimarySecondaryClusters (1969.60s)
--- PASS: TestAccAWSRDSCluster_GlobalClusterIdentifier_ReplicationSourceIdentifier (1819.35s)

--- PASS: TestAccAWSRDSCluster_ReplicationSourceIdentifier_KmsKeyId (1691.11s)

--- PASS: TestAccAWSRedshiftCluster_snapshotCopy (631.18s)

--- PASS: TestAccAWSRedshiftSecurityGroup_basic (11.11s)
--- PASS: TestAccAWSRedshiftSecurityGroup_ingressCidr (11.10s)
--- PASS: TestAccAWSRedshiftSecurityGroup_ingressSecurityGroup (12.47s)
--- PASS: TestAccAWSRedshiftSecurityGroup_updateIngressCidr (23.94s)
--- PASS: TestAccAWSRedshiftSecurityGroup_updateIngressSecurityGroup (27.22s)

--- PASS: TestAccAWSRoute53VpcAssociationAuthorization_basic (99.00s)
--- PASS: TestAccAWSRoute53VpcAssociationAuthorization_disappears (94.43s)

--- PASS: TestAccAWSRoute53ZoneAssociation_CrossAccount (124.58s)
--- PASS: TestAccAWSRoute53ZoneAssociation_CrossRegion (157.69s)

--- PASS: TestAccAWSS3Bucket_Replication (145.26s)
--- PASS: TestAccAWSS3Bucket_ReplicationConfiguration_Rule_Destination_AccessControlTranslation (86.49s)
--- PASS: TestAccAWSS3Bucket_ReplicationConfiguration_Rule_Destination_AddAccessControlTranslation (84.75s)
--- PASS: TestAccAWSS3Bucket_ReplicationExpectVersioningValidationError (22.79s)
--- PASS: TestAccAWSS3Bucket_ReplicationSchemaV2 (174.11s)
--- PASS: TestAccAWSS3Bucket_ReplicationWithoutPrefix (65.38s)
--- PASS: TestAccAWSS3Bucket_ReplicationWithoutStorageClass (85.05s)
--- PASS: TestAccAWSS3Bucket_SameRegionReplicationSchemaV2 (73.58s)

--- PASS: TestAccAWSSubnet_ignoreTags (86.24s)

--- PASS: TestAccAWSVPCPeeringConnection_accept (144.21s)
--- PASS: TestAccAWSVPCPeeringConnection_basic (65.98s)
--- PASS: TestAccAWSVPCPeeringConnection_failedState (12.38s)
--- PASS: TestAccAWSVPCPeeringConnection_options (117.22s)
--- PASS: TestAccAWSVPCPeeringConnection_optionsNoAutoAccept (29.07s)
--- PASS: TestAccAWSVPCPeeringConnection_peerRegionAutoAccept (29.13s)
--- PASS: TestAccAWSVPCPeeringConnection_plan (52.19s)
--- PASS: TestAccAWSVPCPeeringConnection_region (70.00s)
--- PASS: TestAccAWSVPCPeeringConnection_tags (150.89s)

--- PASS: TestAccAWSVPCPeeringConnectionAccepter_differentRegionDifferentAccount (68.06s)
--- PASS: TestAccAWSVPCPeeringConnectionAccepter_differentRegionSameAccount (83.92s)
--- PASS: TestAccAWSVPCPeeringConnectionAccepter_sameRegionDifferentAccount (64.85s)
--- PASS: TestAccAWSVPCPeeringConnectionAccepter_sameRegionSameAccount (56.44s)

--- PASS: TestAccAWSVpcPeeringConnectionOptions_basic (70.42s)
--- PASS: TestAccAWSVpcPeeringConnectionOptions_differentRegionSameAccount (75.28s)
--- PASS: TestAccAWSVpcPeeringConnectionOptions_sameRegionDifferentAccount (41.96s)

--- FAIL: TestAccDataSourceAwsRoute53ResolverRule_SharedByMe (227.22s)
--- FAIL: TestAccDataSourceAwsRoute53ResolverRule_SharedWithMe (228.00s)

    data_source_aws_route53_resolver_rule_test.go:101: Step 1/1 error: Error running apply: 2020/10/28 22:02:11 [DEBUG] Using modified User-Agent: Terraform/0.12.29 HashiCorp-terraform-exec/0.10.0

        Error: Error associating principal with RAM resource share: UnknownResourceException: Organization o-upyv668dz5 could not be found.

--- FAIL: TestAccAWSEc2TransitGatewayVpcAttachment_SharedTransitGateway (221.84s)

    resource_aws_ec2_transit_gateway_vpc_attachment_test.go:215: Step 1/2 error: Error running apply: 2020/10/28 22:02:10 [DEBUG] Using modified User-Agent: Terraform/0.12.29 HashiCorp-terraform-exec/0.10.0

        Error: Error associating principal with RAM resource share: UnknownResourceException: Organization o-upyv668dz5 could not be found.

        Error: error associating RAM Resource Share: OperationNotPermittedException: The resource you are attempting to share can only be shared within your AWS Organization. This error may also occur if you have not enabled sharing with your AWS organization, or that onboarding process is still in progress.

--- FAIL: TestAccAWSEc2TransitGatewayVpcAttachmentAccepter_Tags (201.45s)
--- FAIL: TestAccAWSEc2TransitGatewayVpcAttachmentAccepter_TransitGatewayDefaultRouteTableAssociationAndPropagation (211.45s)
--- FAIL: TestAccAWSEc2TransitGatewayVpcAttachmentAccepter_basic (221.42s)

    resource_aws_ec2_transit_gateway_vpc_attachment_accepter_test.go:135: Step 1/4 error: Error running apply: 2020/10/28 22:02:11 [DEBUG] Using modified User-Agent: Terraform/0.12.29 HashiCorp-terraform-exec/0.10.0

        Error: error associating RAM Resource Share: OperationNotPermittedException: The resource you are attempting to share can only be shared within your AWS Organization. This error may also occur if you have not enabled sharing with your AWS organization, or that onboarding process is still in progress.

        Error: Error associating principal with RAM resource share: OperationNotPermittedException: The resource you are attempting to share can only be shared within your AWS Organization. This error may also occur if you have not enabled sharing with your AWS organization, or that onboarding process is still in progress.
```
  • Loading branch information
bflad committed Oct 29, 2020
1 parent 695b7c9 commit 62e1f4d
Show file tree
Hide file tree
Showing 31 changed files with 105 additions and 189 deletions.
7 changes: 0 additions & 7 deletions aws/cur_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,3 @@ func testAccGetCurRegion() string {

return testAccCurRegion
}

// testAccProviderFactoriesCur initializes providers for Cost and Usage Reporting testing.
//
// Deprecated: This will be replaced with testAccProviderFactories when it only returns the "aws" provider
func testAccProviderFactoriesCur() map[string]func() (*schema.Provider, error) {
return testAccProviderFactoriesInit(nil, []string{ProviderNameAws})
}
4 changes: 2 additions & 2 deletions aws/data_source_aws_cur_report_definition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func TestAccDataSourceAwsCurReportDefinition_basic(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckCur(t) },
ProviderFactories: testAccProviderFactoriesCur(),
ProviderFactories: testAccProviderFactories,
CheckDestroy: testAccCheckAwsCurReportDefinitionDestroy,
Steps: []resource.TestStep{
{
Expand Down Expand Up @@ -48,7 +48,7 @@ func TestAccDataSourceAwsCurReportDefinition_additional(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckCur(t) },
ProviderFactories: testAccProviderFactoriesCur(),
ProviderFactories: testAccProviderFactories,
CheckDestroy: testAccCheckAwsCurReportDefinitionDestroy,
Steps: []resource.TestStep{
{
Expand Down
8 changes: 2 additions & 6 deletions aws/data_source_aws_db_subnet_group_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,16 @@ import (

"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

func TestAccAWSDbSubnetGroupDataSource_basic(t *testing.T) {
var providers []*schema.Provider
rName := acctest.RandomWithPrefix("tf-acc-test")
resourceName := "aws_db_subnet_group.test"
dataSourceName := "data.aws_db_subnet_group.test"

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ProviderFactories: testAccProviderFactories(&providers),
ProviderFactories: testAccProviderFactories,
Steps: []resource.TestStep{
{
Config: testAccAWSDBSubnetGroupDataSourceConfig(rName),
Expand All @@ -36,11 +34,9 @@ func TestAccAWSDbSubnetGroupDataSource_basic(t *testing.T) {
}

func TestAccAWSDbSubnetGroupDataSource_nonexistent(t *testing.T) {
var providers []*schema.Provider

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t) },
ProviderFactories: testAccProviderFactories(&providers),
ProviderFactories: testAccProviderFactories,
Steps: []resource.TestStep{
{
Config: testAccAWSDBSubnetGroupDataSourceConfig_NonExistent,
Expand Down
4 changes: 2 additions & 2 deletions aws/data_source_aws_route53_resolver_rule_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func TestAccDataSourceAwsRoute53ResolverRule_SharedByMe(t *testing.T) {
testAccAlternateAccountPreCheck(t)
testAccPreCheckAWSRoute53Resolver(t)
},
ProviderFactories: testAccProviderFactories(&providers),
ProviderFactories: testAccProviderFactoriesAlternate(&providers),
Steps: []resource.TestStep{
{
Config: testAccDataSourceAwsRoute53ResolverRule_sharedByMe(rName),
Expand Down Expand Up @@ -141,7 +141,7 @@ func TestAccDataSourceAwsRoute53ResolverRule_SharedWithMe(t *testing.T) {
testAccAlternateAccountPreCheck(t)
testAccPreCheckAWSRoute53Resolver(t)
},
ProviderFactories: testAccProviderFactories(&providers),
ProviderFactories: testAccProviderFactoriesAlternate(&providers),
Steps: []resource.TestStep{
{
Config: testAccDataSourceAwsRoute53ResolverRule_sharedWithMe(rName),
Expand Down
7 changes: 0 additions & 7 deletions aws/ec2_classic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,3 @@ func testAccGetEc2ClassicRegion() string {

return testAccGetRegion()
}

// testAccProviderFactoriesEc2Classic initializes providers for EC2-Classic testing.
//
// Deprecated: This will be replaced with testAccProviderFactories when it only returns the "aws" provider
func testAccProviderFactoriesEc2Classic() map[string]func() (*schema.Provider, error) {
return testAccProviderFactoriesInit(nil, []string{ProviderNameAws})
}
48 changes: 8 additions & 40 deletions aws/provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,22 +54,19 @@ var TestAccSkip = func(t *testing.T, message string) {
t.Skip(message)
}

// testAccProviders is a static map of provider types and their associated provider instance.
// testAccProviders is a static map containing only the main provider instance.
//
// Deprecated: Terraform Plugin SDK version 2 uses TestCase.ProviderFactories
// but supports this value in TestCase.Providers for backwards compatibility.
// In the future Providers: testAccProviders will be changed to
// ProviderFactories: testAccProviderFactories
var testAccProviders map[string]*schema.Provider

// testAccProviderFactories initializes and returns Provider slice elements of a provider type and function that returns the provider instance
// testAccProviderFactories is a static map containing only the main provider instance
//
// Using this function will initialize all listed provider types as gRPC
// plugins for every test, which is inefficient and can cause ulimit issues.
//
// Deprecated: Use specific ProviderFactories functions such as testAccProviderFactoriesEc2Classic instead.
// In the future this will be changed to return only the aws provider and not accept a parameter.
var testAccProviderFactories func(providers *[]*schema.Provider) map[string]func() (*schema.Provider, error)
// Use other testAccProviderFactories functions, such as testAccProviderFactoriesAlternate,
// for tests requiring special provider configurations.
var testAccProviderFactories map[string]func() (*schema.Provider, error)

// testAccProvider is the "main" provider instance
//
Expand All @@ -79,24 +76,15 @@ var testAccProviderFactories func(providers *[]*schema.Provider) map[string]func
// testAccPreCheck(t) must be called before using this provider instance.
var testAccProvider *schema.Provider

// testAccProviderFunc is a function that returns the "main" provider instance
//
// Deprecated: Use testAccAwsRegionProviderFunc instead.
// In the future this will be changed to be compatible with ProviderFactories.
var testAccProviderFunc func() *schema.Provider

func init() {
testAccProvider = Provider()

testAccProviders = map[string]*schema.Provider{
ProviderNameAws: testAccProvider,
}
testAccProviderFactories = func(providers *[]*schema.Provider) map[string]func() (*schema.Provider, error) {
return testAccProviderFactoriesInit(providers, []string{
ProviderNameAws,
ProviderNameAwsAlternate,
})
testAccProviderFactories = map[string]func() (*schema.Provider, error){
ProviderNameAws: func() (*schema.Provider, error) { return testAccProvider, nil },
}
testAccProviderFunc = func() *schema.Provider { return testAccProvider }
}

// testAccProviderFactoriesInit creates ProviderFactories for the provider under testing.
Expand Down Expand Up @@ -615,17 +603,6 @@ func testAccAlternateAccountPreCheck(t *testing.T) {
}
}

// Deprecated: Use testAccMultipleRegionPreCheck instead
func testAccAlternateRegionPreCheck(t *testing.T) {
if testAccGetRegion() == testAccGetAlternateRegion() {
t.Fatal("AWS_DEFAULT_REGION and AWS_ALTERNATE_REGION must be set to different values for acceptance tests")
}

if testAccGetPartition() != testAccGetAlternateRegionPartition() {
t.Fatalf("AWS_ALTERNATE_REGION partition (%s) does not match AWS_DEFAULT_REGION partition (%s)", testAccGetAlternateRegionPartition(), testAccGetPartition())
}
}

func testAccEC2VPCOnlyPreCheck(t *testing.T) {
client := testAccProvider.Meta().(*AWSClient)
platforms := client.supportedplatforms
Expand Down Expand Up @@ -674,15 +651,6 @@ func testAccMultipleRegionPreCheck(t *testing.T, regions int) {
}
}

// Deprecated: Use testAccMultipleRegionPreCheck instead.
func testAccMultipleRegionsPreCheck(t *testing.T) {
if partition, ok := endpoints.PartitionForRegion(endpoints.DefaultPartitions(), testAccGetRegion()); ok {
if len(partition.Regions()) < 2 {
t.Skip("skipping tests; partition only includes a single region")
}
}
}

// testAccRegionPreCheck checks that the test region is the specified region.
func testAccRegionPreCheck(t *testing.T, region string) {
if testAccGetRegion() != region {
Expand Down
7 changes: 2 additions & 5 deletions aws/resource_aws_cloudfront_distribution_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/aws/aws-sdk-go/service/cloudfront"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/acctest"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
"github.com/terraform-providers/terraform-provider-aws/aws/internal/tfawsresource"
)
Expand Down Expand Up @@ -757,13 +756,12 @@ func TestAccAWSCloudFrontDistribution_OrderedCacheBehavior_ForwardedValues_Heade

func TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn(t *testing.T) {
var distribution cloudfront.Distribution
var providers []*schema.Provider
resourceName := "aws_cloudfront_distribution.test"
retainOnDelete := testAccAWSCloudFrontDistributionRetainOnDeleteFromEnv()

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck("cloudfront", t) },
ProviderFactories: testAccProviderFactories(&providers),
ProviderFactories: testAccProviderFactories,
CheckDestroy: testAccCheckCloudFrontDistributionDestroy,
Steps: []resource.TestStep{
{
Expand All @@ -789,13 +787,12 @@ func TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn(t *tes
// Reference: https://github.com/terraform-providers/terraform-provider-aws/issues/7773
func TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn_ConflictsWithCloudFrontDefaultCertificate(t *testing.T) {
var distribution cloudfront.Distribution
var providers []*schema.Provider
resourceName := "aws_cloudfront_distribution.test"
retainOnDelete := testAccAWSCloudFrontDistributionRetainOnDeleteFromEnv()

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPartitionHasServicePreCheck("cloudfront", t) },
ProviderFactories: testAccProviderFactories(&providers),
ProviderFactories: testAccProviderFactories,
CheckDestroy: testAccCheckCloudFrontDistributionDestroy,
Steps: []resource.TestStep{
{
Expand Down
15 changes: 6 additions & 9 deletions aws/resource_aws_codepipeline_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,11 +296,10 @@ func TestAccAWSCodePipeline_multiregion_basic(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() {
testAccPreCheck(t)
testAccMultipleRegionsPreCheck(t)
testAccAlternateRegionPreCheck(t)
testAccMultipleRegionPreCheck(t, 2)
testAccPreCheckAWSCodePipeline(t, testAccGetAlternateRegion())
},
ProviderFactories: testAccProviderFactories(&providers),
ProviderFactories: testAccProviderFactoriesAlternate(&providers),
CheckDestroy: testAccCheckAWSCodePipelineDestroy,
Steps: []resource.TestStep{
{
Expand Down Expand Up @@ -343,11 +342,10 @@ func TestAccAWSCodePipeline_multiregion_Update(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() {
testAccPreCheck(t)
testAccMultipleRegionsPreCheck(t)
testAccAlternateRegionPreCheck(t)
testAccMultipleRegionPreCheck(t, 2)
testAccPreCheckAWSCodePipeline(t, testAccGetAlternateRegion())
},
ProviderFactories: testAccProviderFactories(&providers),
ProviderFactories: testAccProviderFactoriesAlternate(&providers),
CheckDestroy: testAccCheckAWSCodePipelineDestroy,
Steps: []resource.TestStep{
{
Expand Down Expand Up @@ -404,11 +402,10 @@ func TestAccAWSCodePipeline_multiregion_ConvertSingleRegion(t *testing.T) {
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() {
testAccPreCheck(t)
testAccMultipleRegionsPreCheck(t)
testAccAlternateRegionPreCheck(t)
testAccMultipleRegionPreCheck(t, 2)
testAccPreCheckAWSCodePipeline(t, testAccGetAlternateRegion())
},
ProviderFactories: testAccProviderFactories(&providers),
ProviderFactories: testAccProviderFactoriesAlternate(&providers),
CheckDestroy: testAccCheckAWSCodePipelineDestroy,
Steps: []resource.TestStep{
{
Expand Down
12 changes: 6 additions & 6 deletions aws/resource_aws_cur_report_definition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func TestAccAwsCurReportDefinition_basic(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckCur(t) },
ProviderFactories: testAccProviderFactoriesCur(),
ProviderFactories: testAccProviderFactories,
CheckDestroy: testAccCheckAwsCurReportDefinitionDestroy,
Steps: []resource.TestStep{
{
Expand Down Expand Up @@ -54,7 +54,7 @@ func TestAccAwsCurReportDefinition_textOrCsv(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckCur(t) },
ProviderFactories: testAccProviderFactoriesCur(),
ProviderFactories: testAccProviderFactories,
CheckDestroy: testAccCheckAwsCurReportDefinitionDestroy,
Steps: []resource.TestStep{
{
Expand Down Expand Up @@ -92,7 +92,7 @@ func TestAccAwsCurReportDefinition_parquet(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckCur(t) },
ProviderFactories: testAccProviderFactoriesCur(),
ProviderFactories: testAccProviderFactories,
CheckDestroy: testAccCheckAwsCurReportDefinitionDestroy,
Steps: []resource.TestStep{
{
Expand Down Expand Up @@ -129,7 +129,7 @@ func TestAccAwsCurReportDefinition_athena(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckCur(t) },
ProviderFactories: testAccProviderFactoriesCur(),
ProviderFactories: testAccProviderFactories,
CheckDestroy: testAccCheckAwsCurReportDefinitionDestroy,
Steps: []resource.TestStep{
{
Expand Down Expand Up @@ -167,7 +167,7 @@ func TestAccAwsCurReportDefinition_refresh(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckCur(t) },
ProviderFactories: testAccProviderFactoriesCur(),
ProviderFactories: testAccProviderFactories,
CheckDestroy: testAccCheckAwsCurReportDefinitionDestroy,
Steps: []resource.TestStep{
{
Expand Down Expand Up @@ -205,7 +205,7 @@ func TestAccAwsCurReportDefinition_overwrite(t *testing.T) {

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { testAccPreCheck(t); testAccPreCheckCur(t) },
ProviderFactories: testAccProviderFactoriesCur(),
ProviderFactories: testAccProviderFactories,
CheckDestroy: testAccCheckAwsCurReportDefinitionDestroy,
Steps: []resource.TestStep{
{
Expand Down
8 changes: 4 additions & 4 deletions aws/resource_aws_dx_gateway_association_proposal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func TestAccAwsDxGatewayAssociationProposal_basicVpnGateway(t *testing.T) {
testAccPreCheck(t)
testAccAlternateAccountPreCheck(t)
},
ProviderFactories: testAccProviderFactories(&providers),
ProviderFactories: testAccProviderFactoriesAlternate(&providers),
CheckDestroy: testAccCheckAwsDxGatewayAssociationProposalDestroy,
Steps: []resource.TestStep{
{
Expand Down Expand Up @@ -130,7 +130,7 @@ func TestAccAwsDxGatewayAssociationProposal_basicTransitGateway(t *testing.T) {
testAccPreCheck(t)
testAccAlternateAccountPreCheck(t)
},
ProviderFactories: testAccProviderFactories(&providers),
ProviderFactories: testAccProviderFactoriesAlternate(&providers),
CheckDestroy: testAccCheckAwsDxGatewayAssociationProposalDestroy,
Steps: []resource.TestStep{
{
Expand Down Expand Up @@ -168,7 +168,7 @@ func TestAccAwsDxGatewayAssociationProposal_disappears(t *testing.T) {
testAccPreCheck(t)
testAccAlternateAccountPreCheck(t)
},
ProviderFactories: testAccProviderFactories(&providers),
ProviderFactories: testAccProviderFactoriesAlternate(&providers),
CheckDestroy: testAccCheckAwsDxGatewayAssociationProposalDestroy,
Steps: []resource.TestStep{
{
Expand All @@ -195,7 +195,7 @@ func TestAccAwsDxGatewayAssociationProposal_AllowedPrefixes(t *testing.T) {
testAccPreCheck(t)
testAccAlternateAccountPreCheck(t)
},
ProviderFactories: testAccProviderFactories(&providers),
ProviderFactories: testAccProviderFactoriesAlternate(&providers),
CheckDestroy: testAccCheckAwsDxGatewayAssociationProposalDestroy,
Steps: []resource.TestStep{
{
Expand Down
6 changes: 3 additions & 3 deletions aws/resource_aws_dx_gateway_association_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ func TestAccAwsDxGatewayAssociation_basicVpnGatewayCrossAccount(t *testing.T) {
testAccPreCheck(t)
testAccAlternateAccountPreCheck(t)
},
ProviderFactories: testAccProviderFactories(&providers),
ProviderFactories: testAccProviderFactoriesAlternate(&providers),
CheckDestroy: testAccCheckAwsDxGatewayAssociationDestroy,
Steps: []resource.TestStep{
{
Expand Down Expand Up @@ -340,7 +340,7 @@ func TestAccAwsDxGatewayAssociation_basicTransitGatewayCrossAccount(t *testing.T
testAccPreCheck(t)
testAccAlternateAccountPreCheck(t)
},
ProviderFactories: testAccProviderFactories(&providers),
ProviderFactories: testAccProviderFactoriesAlternate(&providers),
CheckDestroy: testAccCheckAwsDxGatewayAssociationDestroy,
Steps: []resource.TestStep{
{
Expand Down Expand Up @@ -441,7 +441,7 @@ func TestAccAwsDxGatewayAssociation_allowedPrefixesVpnGatewayCrossAccount(t *tes
testAccPreCheck(t)
testAccAlternateAccountPreCheck(t)
},
ProviderFactories: testAccProviderFactories(&providers),
ProviderFactories: testAccProviderFactoriesAlternate(&providers),
CheckDestroy: testAccCheckAwsDxGatewayAssociationDestroy,
Steps: []resource.TestStep{
{
Expand Down
4 changes: 2 additions & 2 deletions aws/resource_aws_dx_hosted_private_virtual_interface_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func TestAccAwsDxHostedPrivateVirtualInterface_basic(t *testing.T) {
testAccPreCheck(t)
testAccAlternateAccountPreCheck(t)
},
ProviderFactories: testAccProviderFactories(&providers),
ProviderFactories: testAccProviderFactoriesAlternate(&providers),
CheckDestroy: testAccCheckAwsDxHostedPrivateVirtualInterfaceDestroy,
Steps: []resource.TestStep{
{
Expand Down Expand Up @@ -94,7 +94,7 @@ func TestAccAwsDxHostedPrivateVirtualInterface_AccepterTags(t *testing.T) {
testAccPreCheck(t)
testAccAlternateAccountPreCheck(t)
},
ProviderFactories: testAccProviderFactories(&providers),
ProviderFactories: testAccProviderFactoriesAlternate(&providers),
CheckDestroy: testAccCheckAwsDxHostedPrivateVirtualInterfaceDestroy,
Steps: []resource.TestStep{
{
Expand Down
Loading

0 comments on commit 62e1f4d

Please sign in to comment.