Skip to content

Commit c015ad6

Browse files
authored
tests/provider: Prevent skip issues with special region testing involving multiple tests (#17421)
Reference: #16840 (review) Output from acceptance testing in AWS Commercial: ``` --- FAIL: TestAccAWSAPIGatewayDomainName_CertificateArn (965.31s) # #17420 --- PASS: TestAccAWSAPIGatewayDomainName_disappears (152.03s) --- PASS: TestAccAWSAPIGatewayDomainName_RegionalCertificateArn (110.11s) --- PASS: TestAccAWSAPIGatewayDomainName_SecurityPolicy (115.66s) --- PASS: TestAccAWSAPIGatewayDomainName_Tags (126.40s) --- SKIP: TestAccAWSAPIGatewayDomainName_CertificateName (0.00s) --- SKIP: TestAccAWSAPIGatewayDomainName_RegionalCertificateName (0.00s) --- PASS: TestAccAWSCognitoUserPoolDomain_basic (29.57s) --- PASS: TestAccAWSCognitoUserPoolDomain_custom (770.94s) --- PASS: TestAccAWSCognitoUserPoolDomain_disappears (27.19s) --- PASS: TestAccAWSLightsailDomain_basic (23.82s) --- PASS: TestAccAWSLightsailDomain_disappears (20.95s) --- PASS: TestAccAWSRoute53QueryLog_basic (51.64s) --- PASS: TestAccAWSWafWebAcl_basic (20.01s) --- PASS: TestAccAWSWafWebAcl_changeNameForceNew (45.63s) --- PASS: TestAccAWSWafWebAcl_DefaultAction (36.54s) --- PASS: TestAccAWSWafWebAcl_disappears (21.46s) --- PASS: TestAccAWSWafWebAcl_LoggingConfiguration (110.88s) --- PASS: TestAccAWSWafWebAcl_Rules (60.21s) --- PASS: TestAccAWSWafWebAcl_Tags (50.74s) ``` Output from acceptance testing in AWS GovCloud (US): ``` --- PASS: TestAccAWSAPIGatewayDomainName_disappears (28.66s) --- PASS: TestAccAWSAPIGatewayDomainName_RegionalCertificateArn (79.60s) --- PASS: TestAccAWSAPIGatewayDomainName_SecurityPolicy (110.56s) --- PASS: TestAccAWSAPIGatewayDomainName_Tags (139.40s) --- SKIP: TestAccAWSAPIGatewayDomainName_CertificateArn (0.00s) --- SKIP: TestAccAWSAPIGatewayDomainName_CertificateName (0.00s) --- SKIP: TestAccAWSAPIGatewayDomainName_RegionalCertificateName (0.00s) --- PASS: TestAccAWSCognitoUserPoolDomain_basic (29.53s) --- PASS: TestAccAWSCognitoUserPoolDomain_disappears (25.98s) --- SKIP: TestAccAWSCognitoUserPoolDomain_custom (0.00s) --- SKIP: TestAccAWSLightsailDomain_basic (3.48s) --- SKIP: TestAccAWSLightsailDomain_disappears (3.48s) --- SKIP: TestAccAWSRoute53QueryLog_basic (3.48s) --- SKIP: TestAccAWSWafWebAcl_basic (27.40s) --- SKIP: TestAccAWSWafWebAcl_changeNameForceNew (27.75s) --- SKIP: TestAccAWSWafWebAcl_DefaultAction (21.04s) --- SKIP: TestAccAWSWafWebAcl_disappears (25.19s) --- SKIP: TestAccAWSWafWebAcl_LoggingConfiguration (28.85s) --- SKIP: TestAccAWSWafWebAcl_Rules (30.87s) --- SKIP: TestAccAWSWafWebAcl_Tags (29.67s) ```
1 parent 9362bf1 commit c015ad6

5 files changed

Lines changed: 30 additions & 30 deletions

aws/api_gateway_domain_name_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,17 +37,17 @@ var testAccProviderApigatewayEdgeDomainNameConfigure sync.Once
3737
func testAccPreCheckApigatewayEdgeDomainName(t *testing.T) {
3838
testAccPartitionHasServicePreCheck(apigateway.EndpointsID, t)
3939

40+
region := testAccGetApigatewayEdgeDomainNameRegion()
41+
42+
if region == "" {
43+
t.Skip("API Gateway Domain Name not available in this AWS Partition")
44+
}
45+
4046
// Since we are outside the scope of the Terraform configuration we must
4147
// call Configure() to properly initialize the provider configuration.
4248
testAccProviderApigatewayEdgeDomainNameConfigure.Do(func() {
4349
testAccProviderApigatewayEdgeDomainName = Provider()
4450

45-
region := testAccGetApigatewayEdgeDomainNameRegion()
46-
47-
if region == "" {
48-
t.Skip("API Gateway Domain Name not available in this AWS Partition")
49-
}
50-
5151
config := map[string]interface{}{
5252
"region": region,
5353
}

aws/cognito_user_pool_domain_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,17 @@ var testAccProviderCognitoUserPoolCustomDomainConfigure sync.Once
3434
func testAccPreCheckCognitoUserPoolCustomDomain(t *testing.T) {
3535
testAccPartitionHasServicePreCheck(cognitoidentityprovider.EndpointsID, t)
3636

37+
region := testAccGetCognitoUserPoolCustomDomainRegion()
38+
39+
if region == "" {
40+
t.Skip("Cognito User Pool Custom Domains not available in this AWS Partition")
41+
}
42+
3743
// Since we are outside the scope of the Terraform configuration we must
3844
// call Configure() to properly initialize the provider configuration.
3945
testAccProviderCognitoUserPoolCustomDomainConfigure.Do(func() {
4046
testAccProviderCognitoUserPoolCustomDomain = Provider()
4147

42-
region := testAccGetCognitoUserPoolCustomDomainRegion()
43-
44-
if region == "" {
45-
t.Skip("Cognito User Pool Custom Domains not available in this AWS Partition")
46-
}
47-
4848
config := map[string]interface{}{
4949
"region": region,
5050
}

aws/lightsail_domain_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,15 @@ func init() {
3939
func testAccPreCheckLightsailDomain(t *testing.T) {
4040
testAccPartitionHasServicePreCheck(lightsail.EndpointsID, t)
4141

42+
region := testAccGetLightsailDomainRegion()
43+
44+
if region == "" {
45+
t.Skip("Lightsail Domains not available in this AWS Partition")
46+
}
47+
4248
// Since we are outside the scope of the Terraform configuration we must
4349
// call Configure() to properly initialize the provider configuration.
4450
testAccProviderLightsailDomainConfigure.Do(func() {
45-
region := testAccGetLightsailDomainRegion()
46-
47-
if region == "" {
48-
t.Skip("Lightsail Domains not available in this AWS Partition")
49-
}
50-
5151
config := map[string]interface{}{
5252
"region": region,
5353
}

aws/route53_query_log_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,17 @@ var testAccProviderRoute53QueryLogConfigure sync.Once
3434
func testAccPreCheckRoute53QueryLog(t *testing.T) {
3535
testAccPartitionHasServicePreCheck(route53.EndpointsID, t)
3636

37+
region := testAccGetRoute53QueryLogRegion()
38+
39+
if region == "" {
40+
t.Skip("Route 53 Query Log not available in this AWS Partition")
41+
}
42+
3743
// Since we are outside the scope of the Terraform configuration we must
3844
// call Configure() to properly initialize the provider configuration.
3945
testAccProviderRoute53QueryLogConfigure.Do(func() {
4046
testAccProviderRoute53QueryLog = Provider()
4147

42-
region := testAccGetRoute53QueryLogRegion()
43-
44-
if region == "" {
45-
t.Skip("Route 53 Query Log not available in this AWS Partition")
46-
}
47-
4848
config := map[string]interface{}{
4949
"region": region,
5050
}

aws/waf_logging_configuration_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,17 @@ var testAccProviderWafLoggingConfigurationConfigure sync.Once
3434
func testAccPreCheckWafLoggingConfiguration(t *testing.T) {
3535
testAccPartitionHasServicePreCheck(waf.EndpointsID, t)
3636

37+
region := testAccGetWafLoggingConfigurationRegion()
38+
39+
if region == "" {
40+
t.Skip("WAF Logging Configuration not available in this AWS Partition")
41+
}
42+
3743
// Since we are outside the scope of the Terraform configuration we must
3844
// call Configure() to properly initialize the provider configuration.
3945
testAccProviderWafLoggingConfigurationConfigure.Do(func() {
4046
testAccProviderWafLoggingConfiguration = Provider()
4147

42-
region := testAccGetWafLoggingConfigurationRegion()
43-
44-
if region == "" {
45-
t.Skip("WAF Logging Configuration not available in this AWS Partition")
46-
}
47-
4848
config := map[string]interface{}{
4949
"region": region,
5050
}

0 commit comments

Comments
 (0)