Skip to content

Fix data.aws_launch_template acceptance test regressions#16360

Closed
hansnielsen wants to merge 1 commit into
hashicorp:masterfrom
hansnielsen:b-aws_launch_template-test-regression
Closed

Fix data.aws_launch_template acceptance test regressions#16360
hansnielsen wants to merge 1 commit into
hashicorp:masterfrom
hansnielsen:b-aws_launch_template-test-regression

Conversation

@hansnielsen

Copy link
Copy Markdown
Contributor

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment 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 pull request followers and do not help prioritize the request

Release note for CHANGELOG:

NONE

This PR fixes some acceptance tests that no longer work as of Terraform v0.13.5.

Original (broken) acceptance testing output:

$ make testacc TESTARGS='-run=TestAccAWSLaunchTemplateDataSource'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSLaunchTemplateDataSource -timeout 120m
=== RUN   TestAccAWSLaunchTemplateDataSource_basic
=== PAUSE TestAccAWSLaunchTemplateDataSource_basic
=== RUN   TestAccAWSLaunchTemplateDataSource_filter_basic
=== PAUSE TestAccAWSLaunchTemplateDataSource_filter_basic
=== RUN   TestAccAWSLaunchTemplateDataSource_filter_tags
=== PAUSE TestAccAWSLaunchTemplateDataSource_filter_tags
=== RUN   TestAccAWSLaunchTemplateDataSource_metadataOptions
=== PAUSE TestAccAWSLaunchTemplateDataSource_metadataOptions
=== RUN   TestAccAWSLaunchTemplateDataSource_associatePublicIPAddress
=== PAUSE TestAccAWSLaunchTemplateDataSource_associatePublicIPAddress
=== RUN   TestAccAWSLaunchTemplateDataSource_networkInterfaces_deleteOnTermination
=== PAUSE TestAccAWSLaunchTemplateDataSource_networkInterfaces_deleteOnTermination
=== RUN   TestAccAWSLaunchTemplateDataSource_NonExistent
=== PAUSE TestAccAWSLaunchTemplateDataSource_NonExistent
=== CONT  TestAccAWSLaunchTemplateDataSource_basic
=== CONT  TestAccAWSLaunchTemplateDataSource_metadataOptions
=== CONT  TestAccAWSLaunchTemplateDataSource_associatePublicIPAddress
=== CONT  TestAccAWSLaunchTemplateDataSource_NonExistent
=== CONT  TestAccAWSLaunchTemplateDataSource_networkInterfaces_deleteOnTermination
=== CONT  TestAccAWSLaunchTemplateDataSource_filter_tags
=== CONT  TestAccAWSLaunchTemplateDataSource_filter_basic
--- PASS: TestAccAWSLaunchTemplateDataSource_NonExistent (56.05s)
=== CONT  TestAccAWSLaunchTemplateDataSource_basic
    data_source_aws_launch_template_test.go:17: Step 1/1 error: Error running pre-apply plan:
        Error: Launch Template not found


=== CONT  TestAccAWSLaunchTemplateDataSource_metadataOptions
    data_source_aws_launch_template_test.go:110: Step 1/1 error: Error running pre-apply plan:
        Error: Launch Template not found


=== CONT  TestAccAWSLaunchTemplateDataSource_filter_basic
    data_source_aws_launch_template_test.go:41: Step 1/1 error: Error running pre-apply plan:
        Error: error reading launch template: empty output


=== CONT  TestAccAWSLaunchTemplateDataSource_networkInterfaces_deleteOnTermination
    data_source_aws_launch_template_test.go:189: Step 1/3 error: Error running pre-apply plan:
        Error: Launch Template not found


=== CONT  TestAccAWSLaunchTemplateDataSource_associatePublicIPAddress
    data_source_aws_launch_template_test.go:154: Step 1/3 error: Error running pre-apply plan:
        Error: Launch Template not found


=== CONT  TestAccAWSLaunchTemplateDataSource_filter_tags
    data_source_aws_launch_template_test.go:86: Step 1/1 error: Error running pre-apply plan:
        Error: error reading launch template: empty output


--- FAIL: TestAccAWSLaunchTemplateDataSource_basic (68.69s)
--- FAIL: TestAccAWSLaunchTemplateDataSource_metadataOptions (69.27s)
--- FAIL: TestAccAWSLaunchTemplateDataSource_filter_basic (69.74s)
--- FAIL: TestAccAWSLaunchTemplateDataSource_networkInterfaces_deleteOnTermination (70.05s)
--- FAIL: TestAccAWSLaunchTemplateDataSource_associatePublicIPAddress (70.12s)
--- FAIL: TestAccAWSLaunchTemplateDataSource_filter_tags (70.35s)
FAIL
FAIL	github.com/terraform-providers/terraform-provider-aws/aws	70.445s
FAIL
make: *** [testacc] Error 1

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSLaunchTemplateDataSource'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAWSLaunchTemplateDataSource -timeout 120m
=== RUN   TestAccAWSLaunchTemplateDataSource_basic
=== PAUSE TestAccAWSLaunchTemplateDataSource_basic
=== RUN   TestAccAWSLaunchTemplateDataSource_filter_basic
=== PAUSE TestAccAWSLaunchTemplateDataSource_filter_basic
=== RUN   TestAccAWSLaunchTemplateDataSource_filter_tags
=== PAUSE TestAccAWSLaunchTemplateDataSource_filter_tags
=== RUN   TestAccAWSLaunchTemplateDataSource_metadataOptions
=== PAUSE TestAccAWSLaunchTemplateDataSource_metadataOptions
=== RUN   TestAccAWSLaunchTemplateDataSource_associatePublicIPAddress
=== PAUSE TestAccAWSLaunchTemplateDataSource_associatePublicIPAddress
=== RUN   TestAccAWSLaunchTemplateDataSource_networkInterfaces_deleteOnTermination
=== PAUSE TestAccAWSLaunchTemplateDataSource_networkInterfaces_deleteOnTermination
=== RUN   TestAccAWSLaunchTemplateDataSource_NonExistent
=== PAUSE TestAccAWSLaunchTemplateDataSource_NonExistent
=== CONT  TestAccAWSLaunchTemplateDataSource_basic
=== CONT  TestAccAWSLaunchTemplateDataSource_associatePublicIPAddress
=== CONT  TestAccAWSLaunchTemplateDataSource_NonExistent
=== CONT  TestAccAWSLaunchTemplateDataSource_networkInterfaces_deleteOnTermination
=== CONT  TestAccAWSLaunchTemplateDataSource_filter_tags
=== CONT  TestAccAWSLaunchTemplateDataSource_metadataOptions
=== CONT  TestAccAWSLaunchTemplateDataSource_filter_basic
--- PASS: TestAccAWSLaunchTemplateDataSource_NonExistent (47.99s)
--- PASS: TestAccAWSLaunchTemplateDataSource_metadataOptions (118.02s)
--- PASS: TestAccAWSLaunchTemplateDataSource_basic (120.90s)
--- PASS: TestAccAWSLaunchTemplateDataSource_filter_tags (120.95s)
--- PASS: TestAccAWSLaunchTemplateDataSource_filter_basic (122.81s)
--- PASS: TestAccAWSLaunchTemplateDataSource_associatePublicIPAddress (196.32s)
--- PASS: TestAccAWSLaunchTemplateDataSource_networkInterfaces_deleteOnTermination (199.04s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	199.146s

@hansnielsen hansnielsen requested a review from a team as a code owner November 21, 2020 07:07
@ghost ghost added size/XS Managed by automation to categorize the size of a PR. service/ec2 Issues and PRs that pertain to the ec2 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Nov 21, 2020
@github-actions github-actions Bot added the needs-triage Waiting for first response or review from a maintainer. label Nov 21, 2020

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Welcome @hansnielsen 👋

It looks like this is your first Pull Request submission to the Terraform AWS Provider! If you haven’t already done so please make sure you have checked out our CONTRIBUTING guide and FAQ to make sure your contribution is adhering to best practice and has all the necessary elements in place for a successful approval.

Also take a look at our FAQ which details how we prioritize Pull Requests for inclusion.

Thanks again, and welcome to the community! 😃

@bflad

bflad commented Nov 23, 2020

Copy link
Copy Markdown
Contributor

Hi @hansnielsen 👋 Thank you for providing these testing adjustments and sorry for the hassle here.

This testing issue unfortunately breaks Terraform 0.12.x testing, which we have kept as our default Terraform CLI version for now knowing this type of issue will resolve itself again with Terraform 0.14 coming in roughly 2 weeks. Rather than break our testing in the opposite direction since we will want to keep running regression testing for 0.12.x until we phase out provider support for that version, we are opting to keep depends_on out of the data source configurations. Given that, I'm going to close this pull request.

To temporarily workaround this issue until Terraform 0.14 is out, you can tell the acceptance testing to use a different Terraform CLI binary with the TF_ACC_TERRAFORM_PATH environment variable.

A real fix for the ~150+ tests affected by this issue would be splitting the TestStep, however we are trying to be pragmatic about not spending the time to adjust the tests when the issue will resolve itself shortly again. Thanks again for raising this though.

@bflad bflad closed this Nov 23, 2020
@hansnielsen

Copy link
Copy Markdown
Contributor Author

Good to know! For the other PR I submitted that relies on this behavior (#16361), do you have an example of how to split this test so that it doesn't rely on depends_on?

@ghost

ghost commented Dec 23, 2020

Copy link
Copy Markdown

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 23, 2020
@breathingdust breathingdust removed the needs-triage Waiting for first response or review from a maintainer. label Sep 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

service/ec2 Issues and PRs that pertain to the ec2 service. size/XS Managed by automation to categorize the size of a PR. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants