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

r/spot_instance_request: add import support + refactor tests #12787

Merged
merged 21 commits into from
Feb 18, 2021

Conversation

DrFaust92
Copy link
Collaborator

@DrFaust92 DrFaust92 commented Apr 12, 2020

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

Relates #13826

Release note for CHANGELOG:

resource_aws_spot_instance_request: add plan time validation for `spot_type`
resource_aws_spot_instance_request: import support

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccAWSSpotInstanceRequest_'
--- PASS: TestAccAWSSpotInstanceRequest_basic (128.48s)
--- PASS: TestAccAWSSpotInstanceRequest_withLaunchGroup (134.96s)
--- PASS: TestAccAWSSpotInstanceRequest_withBlockDuration (103.59s)
--- PASS: TestAccAWSSpotInstanceRequest_validUntil (224.48s)
--- PASS: TestAccAWSSpotInstanceRequest_withoutSpotPrice (225.46s)
--- PASS: TestAccAWSSpotInstanceRequest_SubnetAndSGAndPublicIpAddress (325.17s)
--- PASS: TestAccAWSSpotInstanceRequest_NetworkInterfaceAttributes (274.46s)
--- PASS: TestAccAWSSpotInstanceRequest_getPasswordData (370.91s)
--- PASS: TestAccAWSSpotInstanceRequest_disappears (52.47s)
--- PASS: TestAccAWSSpotInstanceRequest_vpc (257.92s)

@ghost ghost added size/XL Managed by automation to categorize the size of a PR. needs-triage Waiting for first response or review from a maintainer. service/ec2 Issues and PRs that pertain to the ec2 service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Apr 12, 2020
@DrFaust92 DrFaust92 marked this pull request as ready for review April 12, 2020 15:24
@DrFaust92 DrFaust92 requested a review from a team April 12, 2020 15:24
@ewbankkit
Copy link
Contributor

ewbankkit commented Apr 13, 2020

Verified acceptance tests:

$ make testacc TEST=./aws/ TESTARGS='-run=TestAccAWSSpotInstanceRequest_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -count 1 -parallel 20 -run=TestAccAWSSpotInstanceRequest_ -timeout 120m
=== RUN   TestAccAWSSpotInstanceRequest_basic
=== PAUSE TestAccAWSSpotInstanceRequest_basic
=== RUN   TestAccAWSSpotInstanceRequest_withLaunchGroup
=== PAUSE TestAccAWSSpotInstanceRequest_withLaunchGroup
=== RUN   TestAccAWSSpotInstanceRequest_withBlockDuration
=== PAUSE TestAccAWSSpotInstanceRequest_withBlockDuration
=== RUN   TestAccAWSSpotInstanceRequest_vpc
=== PAUSE TestAccAWSSpotInstanceRequest_vpc
=== RUN   TestAccAWSSpotInstanceRequest_validUntil
=== PAUSE TestAccAWSSpotInstanceRequest_validUntil
=== RUN   TestAccAWSSpotInstanceRequest_withoutSpotPrice
=== PAUSE TestAccAWSSpotInstanceRequest_withoutSpotPrice
=== RUN   TestAccAWSSpotInstanceRequest_SubnetAndSGAndPublicIpAddress
=== PAUSE TestAccAWSSpotInstanceRequest_SubnetAndSGAndPublicIpAddress
=== RUN   TestAccAWSSpotInstanceRequest_NetworkInterfaceAttributes
=== PAUSE TestAccAWSSpotInstanceRequest_NetworkInterfaceAttributes
=== RUN   TestAccAWSSpotInstanceRequest_getPasswordData
=== PAUSE TestAccAWSSpotInstanceRequest_getPasswordData
=== RUN   TestAccAWSSpotInstanceRequest_disappears
=== PAUSE TestAccAWSSpotInstanceRequest_disappears
=== CONT  TestAccAWSSpotInstanceRequest_basic
=== CONT  TestAccAWSSpotInstanceRequest_SubnetAndSGAndPublicIpAddress
=== CONT  TestAccAWSSpotInstanceRequest_disappears
=== CONT  TestAccAWSSpotInstanceRequest_getPasswordData
=== CONT  TestAccAWSSpotInstanceRequest_NetworkInterfaceAttributes
=== CONT  TestAccAWSSpotInstanceRequest_withoutSpotPrice
=== CONT  TestAccAWSSpotInstanceRequest_withBlockDuration
=== CONT  TestAccAWSSpotInstanceRequest_withLaunchGroup
=== CONT  TestAccAWSSpotInstanceRequest_validUntil
=== CONT  TestAccAWSSpotInstanceRequest_vpc
--- PASS: TestAccAWSSpotInstanceRequest_disappears (35.42s)
--- FAIL: TestAccAWSSpotInstanceRequest_vpc (78.65s)
    testing.go:669: Step 0 error: Check failed: Check 4/6 error: Expected exactly 1 network interface, found 0
--- PASS: TestAccAWSSpotInstanceRequest_basic (110.43s)
--- PASS: TestAccAWSSpotInstanceRequest_validUntil (110.43s)
--- PASS: TestAccAWSSpotInstanceRequest_withoutSpotPrice (110.50s)
--- PASS: TestAccAWSSpotInstanceRequest_NetworkInterfaceAttributes (120.55s)
--- PASS: TestAccAWSSpotInstanceRequest_withBlockDuration (120.70s)
--- PASS: TestAccAWSSpotInstanceRequest_SubnetAndSGAndPublicIpAddress (131.03s)
--- PASS: TestAccAWSSpotInstanceRequest_withLaunchGroup (141.50s)
--- PASS: TestAccAWSSpotInstanceRequest_getPasswordData (241.43s)
FAIL
FAIL	github.com/terraform-providers/terraform-provider-aws/aws	241.463s
FAIL
GNUmakefile:26: recipe for target 'testacc' failed
make: *** [testacc] Error 1

To fix the TestAccAWSSpotInstanceRequest_vpc error I think you'll need to add back the subnet_id attribute:

https://github.com/terraform-providers/terraform-provider-aws/blob/41561e8ba2a64616d1f43bf07a2cb2d5fa1b7425/aws/resource_aws_spot_instance_request_test.go#L715-L716

@DrFaust92 DrFaust92 force-pushed the r/spot_instance_request_refactor branch from 631d03d to 7faab9b Compare April 23, 2020 14:38
@DrFaust92
Copy link
Collaborator Author

fixed vpc test + rebased

@DrFaust92 DrFaust92 force-pushed the r/spot_instance_request_refactor branch 2 times, most recently from 8f9ac59 to a37777c Compare April 28, 2020 19:33
@DrFaust92 DrFaust92 changed the title r/spot_instance_request: add plan time validation for spot_type + refactor tests r/spot_instance_request: add import support Apr 28, 2020
@DrFaust92 DrFaust92 changed the title r/spot_instance_request: add import support [WUP]r/spot_instance_request: add plan time validation for spot_type + refactor tests Apr 28, 2020
@DrFaust92 DrFaust92 changed the title [WUP]r/spot_instance_request: add plan time validation for spot_type + refactor tests [WIP]r/spot_instance_request: add plan time validation for spot_type + refactor tests Apr 28, 2020
@DrFaust92 DrFaust92 changed the title [WIP]r/spot_instance_request: add plan time validation for spot_type + refactor tests r/spot_instance_request: add plan time validation for spot_type + refactor tests Apr 28, 2020
@DrFaust92 DrFaust92 force-pushed the r/spot_instance_request_refactor branch from f0b9cb5 to bf75f7d Compare May 8, 2020 16:35
@DrFaust92 DrFaust92 changed the title r/spot_instance_request: add plan time validation for spot_type + refactor tests r/spot_instance_request: add import support + refactor tests May 8, 2020
@DrFaust92
Copy link
Collaborator Author

changed this up a bit to support import

@DrFaust92 DrFaust92 changed the title r/spot_instance_request: add import support + refactor tests [WIP]r/spot_instance_request: add import support + refactor tests May 8, 2020
@DrFaust92 DrFaust92 changed the title [WIP]r/spot_instance_request: add import support + refactor tests r/spot_instance_request: add import support + refactor tests May 9, 2020
@DrFaust92
Copy link
Collaborator Author

tests are now passing!

--- PASS: TestAccAWSSpotInstanceRequest_basic (130.78s)
--- PASS: TestAccAWSSpotInstanceRequest_withLaunchGroup (142.07s)
--- PASS: TestAccAWSSpotInstanceRequest_withBlockDuration (118.47s)
--- PASS: TestAccAWSSpotInstanceRequest_vpc (141.48s)
--- PASS: TestAccAWSSpotInstanceRequest_validUntil (118.15s)
--- PASS: TestAccAWSSpotInstanceRequest_withoutSpotPrice (123.61s)
--- PASS: TestAccAWSSpotInstanceRequest_SubnetAndSGAndPublicIpAddress (135.58s)
--- PASS: TestAccAWSSpotInstanceRequest_NetworkInterfaceAttributes (190.08s)
--- PASS: TestAccAWSSpotInstanceRequest_getPasswordData (185.17s)
--- PASS: TestAccAWSSpotInstanceRequest_disappears (317.70s)
--- PASS: TestAccAWSSpotInstanceRequest_tags (173.89s)

@DrFaust92 DrFaust92 added enhancement Requests to existing resources that expand the functionality or scope. and removed needs-triage Waiting for first response or review from a maintainer. labels Jun 25, 2020
Base automatically changed from master to main January 23, 2021 00:57
@breathingdust breathingdust requested a review from a team as a code owner January 23, 2021 00:57
@bflad
Copy link
Contributor

bflad commented Feb 16, 2021

Hey @DrFaust92 👋 We would love to pick this up on Thursday as part of some gardening work. If you could rebase this and add a changelog file that would be awesome. Thank you!

@DrFaust92 DrFaust92 force-pushed the r/spot_instance_request_refactor branch from 98fd1af to b52388e Compare February 17, 2021 14:26
@DrFaust92
Copy link
Collaborator Author

rebased

--- PASS: TestAccAWSSpotInstanceRequest_withLaunchGroup (100.86s)
--- PASS: TestAccAWSSpotInstanceRequest_withoutSpotPrice (111.34s)
--- PASS: TestAccAWSSpotInstanceRequest_validUntil (122.31s)
--- PASS: TestAccAWSSpotInstanceRequest_vpc (123.80s)
--- PASS: TestAccAWSSpotInstanceRequest_InterruptHibernate (128.79s)
--- PASS: TestAccAWSSpotInstanceRequest_InterruptStop (128.99s)
--- PASS: TestAccAWSSpotInstanceRequest_basic (133.63s)
--- PASS: TestAccAWSSpotInstanceRequest_NetworkInterfaceAttributes (137.37s)
--- PASS: TestAccAWSSpotInstanceRequest_withBlockDuration (144.44s)
--- PASS: TestAccAWSSpotInstanceRequest_SubnetAndSGAndPublicIpAddress (159.34s)
--- PASS: TestAccAWSSpotInstanceRequest_getPasswordData (198.25s)
--- PASS: TestAccAWSSpotInstanceRequest_tags (198.60s)
--- PASS: TestAccAWSSpotInstanceRequest_disappears (333.04s)

@bflad bflad self-assigned this Feb 18, 2021
Copy link
Contributor

@bflad bflad left a comment

Choose a reason for hiding this comment

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

Looks good to me, thank you, @DrFaust92 🚀

Output from acceptance testing in AWS Commercial:

--- PASS: TestAccAWSEIPAssociation_spotInstance (324.66s)

--- PASS: TestAccAWSSpotInstanceRequest_basic (343.84s)
--- PASS: TestAccAWSSpotInstanceRequest_disappears (313.80s)
--- PASS: TestAccAWSSpotInstanceRequest_getPasswordData (212.62s)
--- PASS: TestAccAWSSpotInstanceRequest_InterruptHibernate (327.43s)
--- PASS: TestAccAWSSpotInstanceRequest_InterruptStop (88.75s)
--- PASS: TestAccAWSSpotInstanceRequest_NetworkInterfaceAttributes (341.21s)
--- PASS: TestAccAWSSpotInstanceRequest_SubnetAndSGAndPublicIpAddress (351.06s)
--- PASS: TestAccAWSSpotInstanceRequest_tags (152.64s)
--- PASS: TestAccAWSSpotInstanceRequest_validUntil (339.82s)
--- PASS: TestAccAWSSpotInstanceRequest_vpc (341.75s)
--- PASS: TestAccAWSSpotInstanceRequest_withBlockDuration (333.88s)
--- PASS: TestAccAWSSpotInstanceRequest_withLaunchGroup (308.06s)
--- PASS: TestAccAWSSpotInstanceRequest_withoutSpotPrice (79.75s)

Output from acceptance testing in AWS GovCloud (US):

--- PASS: TestAccAWSEIPAssociation_spotInstance (139.29s)

--- PASS: TestAccAWSSpotInstanceRequest_basic (127.90s)
--- PASS: TestAccAWSSpotInstanceRequest_disappears (309.16s)
--- PASS: TestAccAWSSpotInstanceRequest_getPasswordData (203.89s)
--- PASS: TestAccAWSSpotInstanceRequest_InterruptHibernate (125.23s)
--- PASS: TestAccAWSSpotInstanceRequest_InterruptStop (105.36s)
--- PASS: TestAccAWSSpotInstanceRequest_NetworkInterfaceAttributes (138.38s)
--- PASS: TestAccAWSSpotInstanceRequest_SubnetAndSGAndPublicIpAddress (140.94s)
--- PASS: TestAccAWSSpotInstanceRequest_tags (186.82s)
--- PASS: TestAccAWSSpotInstanceRequest_validUntil (317.22s)
--- PASS: TestAccAWSSpotInstanceRequest_vpc (120.42s)
--- PASS: TestAccAWSSpotInstanceRequest_withBlockDuration (326.41s)
--- PASS: TestAccAWSSpotInstanceRequest_withLaunchGroup (315.90s)
--- PASS: TestAccAWSSpotInstanceRequest_withoutSpotPrice (100.39s)

@bflad bflad merged commit 4a51c4b into hashicorp:main Feb 18, 2021
@github-actions github-actions bot added this to the v3.29.0 milestone Feb 18, 2021
@ghost
Copy link

ghost commented Feb 19, 2021

This has been released in version 3.29.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 Mar 20, 2021

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 Mar 20, 2021
@DrFaust92 DrFaust92 deleted the r/spot_instance_request_refactor branch April 15, 2021 10:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/ec2 Issues and PRs that pertain to the ec2 service. size/XL 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