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

Improve aws_api_gateway_domain_name acceptance tests #14664

Closed
gdavison opened this issue Aug 14, 2020 · 3 comments · Fixed by #16139
Closed

Improve aws_api_gateway_domain_name acceptance tests #14664

gdavison opened this issue Aug 14, 2020 · 3 comments · Fixed by #16139
Assignees
Labels
service/apigateway Issues and PRs that pertain to the apigateway service. technical-debt Addresses areas of the codebase that need refactoring or redesign. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Milestone

Comments

@gdavison
Copy link
Contributor

gdavison commented Aug 14, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

The basic acceptance test cases should verify all fields have expected values, including that values expected to be empty are empty. For example, when using EDGE endpoints, regional_domain_name should be empty, and when using REGIONAL endpoints, cloudfront_domain_name should be empty.

Typically, uses of resource.TestCheckResourceAttrSet() should be avoided, and replaced with more specific tests. For example, cloudfront_domain_name should match [a-z0-9]+.cloudfront.net and regional_domain_name should use testAccMatchResourceAttrRegionalHostname() with the pattern d-[a-z0-9]+.

Rather than using environment variables to specify existing certificates, in many cases creating a certificate in the test using DNS validation can be used so that the test can be run consistently.

Affected Resource

  • aws_api_gateway_domain_name
@gdavison gdavison added enhancement Requests to existing resources that expand the functionality or scope. technical-debt Addresses areas of the codebase that need refactoring or redesign. service/apigateway Issues and PRs that pertain to the apigateway service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. and removed enhancement Requests to existing resources that expand the functionality or scope. labels Aug 14, 2020
@ewbankkit

This comment has been minimized.

@bflad bflad self-assigned this Nov 11, 2020
bflad added a commit that referenced this issue Nov 11, 2020
…ent variable handling, create public ACM certificate, improve state value checks

Reference: #8316
Reference: #14664
Reference: #15737

Output from acceptance testing in AWS Commercial:

```
--- PASS: TestAccAWSAPIGatewayDomainName_disappears (20.54s)
--- PASS: TestAccAWSAPIGatewayDomainName_RegionalCertificateArn (81.84s)
--- PASS: TestAccAWSAPIGatewayDomainName_SecurityPolicy (139.42s)
--- PASS: TestAccAWSAPIGatewayDomainName_Tags (203.73s)
--- SKIP: TestAccAWSAPIGatewayDomainName_CertificateName (0.00s)
--- SKIP: TestAccAWSAPIGatewayDomainName_RegionalCertificateName (0.00s)
```

Output from acceptance testing in AWS GovCloud (US) (other tests failing with ACM quota limits):

```
--- SKIP: TestAccAWSAPIGatewayDomainName_CertificateArn (1.58s)
```
@bflad bflad added this to the v3.15.0 milestone Nov 12, 2020
bflad added a commit that referenced this issue Nov 12, 2020
…ent variable handling, create public ACM certificate, improve state value checks (#16139)

Reference: #8316
Reference: #14664
Reference: #15737

Output from acceptance testing in AWS Commercial:

```
--- PASS: TestAccAWSAPIGatewayDomainName_disappears (20.54s)
--- PASS: TestAccAWSAPIGatewayDomainName_RegionalCertificateArn (81.84s)
--- PASS: TestAccAWSAPIGatewayDomainName_SecurityPolicy (139.42s)
--- PASS: TestAccAWSAPIGatewayDomainName_Tags (203.73s)
--- SKIP: TestAccAWSAPIGatewayDomainName_CertificateName (0.00s)
--- SKIP: TestAccAWSAPIGatewayDomainName_RegionalCertificateName (0.00s)
```

Output from acceptance testing in AWS GovCloud (US) (other tests failing with ACM quota limits):

```
--- SKIP: TestAccAWSAPIGatewayDomainName_CertificateArn (1.58s)
```
@ghost
Copy link

ghost commented Nov 12, 2020

This has been released in version 3.15.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Dec 12, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked as resolved and limited conversation to collaborators Dec 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/apigateway Issues and PRs that pertain to the apigateway service. technical-debt Addresses areas of the codebase that need refactoring or redesign. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.
Projects
None yet
3 participants