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

Fixes a bug and added test sweeper for Appstream Fleets and Stacks #21125

Merged
merged 5 commits into from
Oct 5, 2021

Conversation

coderGo93
Copy link
Contributor

@coderGo93 coderGo93 commented Oct 1, 2021

  • Added more error validation for appstream Fleet and Stack to avoid a possibly bug when if fails in other resource even in the appstream resource doesn't show error(e.g., error in subnet configuration).
  • Added sweepers for Test Appstream Fleet and Stack

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

Closes #20994
Closes #20993

Output from acceptance testing:

AppStream Fleet

$  make testacc TESTARGS='-run=TestAccAwsAppStreamFleet'                        
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAwsAppStreamFleet -timeout 180m
=== RUN   TestAccAwsAppStreamFleet_basic
=== PAUSE TestAccAwsAppStreamFleet_basic
=== RUN   TestAccAwsAppStreamFleet_disappears
=== PAUSE TestAccAwsAppStreamFleet_disappears
=== RUN   TestAccAwsAppStreamFleet_completeWithStop
=== PAUSE TestAccAwsAppStreamFleet_completeWithStop
=== RUN   TestAccAwsAppStreamFleet_completeWithoutStop
=== PAUSE TestAccAwsAppStreamFleet_completeWithoutStop
=== RUN   TestAccAwsAppStreamFleet_withTags
=== PAUSE TestAccAwsAppStreamFleet_withTags
=== CONT  TestAccAwsAppStreamFleet_basic
=== CONT  TestAccAwsAppStreamFleet_completeWithoutStop
=== CONT  TestAccAwsAppStreamFleet_disappears
=== CONT  TestAccAwsAppStreamFleet_withTags
=== CONT  TestAccAwsAppStreamFleet_completeWithStop
--- PASS: TestAccAwsAppStreamFleet_basic (1186.65s)
--- PASS: TestAccAwsAppStreamFleet_withTags (1220.17s)
--- PASS: TestAccAwsAppStreamFleet_disappears (1221.69s)
--- PASS: TestAccAwsAppStreamFleet_completeWithoutStop (1284.49s)
--- PASS: TestAccAwsAppStreamFleet_completeWithStop (2376.10s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       2376.167s


...

AppStream Stack

$ make testacc TESTARGS='-run=TestAccAwsAppStreamStack'                        
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAwsAppStreamStack -timeout 180m
=== RUN   TestAccAwsAppStreamStack_basic
=== PAUSE TestAccAwsAppStreamStack_basic
=== RUN   TestAccAwsAppStreamStack_disappears
=== PAUSE TestAccAwsAppStreamStack_disappears
=== RUN   TestAccAwsAppStreamStack_complete
=== PAUSE TestAccAwsAppStreamStack_complete
=== RUN   TestAccAwsAppStreamStack_withTags
=== PAUSE TestAccAwsAppStreamStack_withTags
=== CONT  TestAccAwsAppStreamStack_basic
=== CONT  TestAccAwsAppStreamStack_withTags
=== CONT  TestAccAwsAppStreamStack_complete
=== CONT  TestAccAwsAppStreamStack_disappears
--- PASS: TestAccAwsAppStreamStack_disappears (20.40s)
--- PASS: TestAccAwsAppStreamStack_basic (25.25s)
--- PASS: TestAccAwsAppStreamStack_withTags (52.00s)
--- PASS: TestAccAwsAppStreamStack_complete (64.18s)
PASS
ok      github.com/terraform-providers/terraform-provider-aws/aws       64.249s


...

@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. size/L Managed by automation to categorize the size of a PR. service/appstream Issues and PRs that pertain to the appstream service. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. labels Oct 1, 2021
@breathingdust breathingdust removed the needs-triage Waiting for first response or review from a maintainer. label Oct 4, 2021
Copy link
Contributor

@ewbankkit ewbankkit left a comment

Choose a reason for hiding this comment

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

LGTM 🚀.

Commercial
% make testacc TESTARGS='-run=TestAccAwsAppStreamFleet_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAwsAppStreamFleet_ -timeout 180m
=== RUN   TestAccAwsAppStreamFleet_basic
=== PAUSE TestAccAwsAppStreamFleet_basic
=== RUN   TestAccAwsAppStreamFleet_disappears
=== PAUSE TestAccAwsAppStreamFleet_disappears
=== RUN   TestAccAwsAppStreamFleet_completeWithStop
=== PAUSE TestAccAwsAppStreamFleet_completeWithStop
=== RUN   TestAccAwsAppStreamFleet_completeWithoutStop
=== PAUSE TestAccAwsAppStreamFleet_completeWithoutStop
=== RUN   TestAccAwsAppStreamFleet_withTags
=== PAUSE TestAccAwsAppStreamFleet_withTags
=== CONT  TestAccAwsAppStreamFleet_basic
=== CONT  TestAccAwsAppStreamFleet_completeWithoutStop
=== CONT  TestAccAwsAppStreamFleet_withTags
=== CONT  TestAccAwsAppStreamFleet_completeWithStop
=== CONT  TestAccAwsAppStreamFleet_disappears
--- PASS: TestAccAwsAppStreamFleet_disappears (926.54s)
--- PASS: TestAccAwsAppStreamFleet_completeWithoutStop (955.72s)
--- PASS: TestAccAwsAppStreamFleet_basic (963.26s)
--- PASS: TestAccAwsAppStreamFleet_withTags (1008.73s)
--- PASS: TestAccAwsAppStreamFleet_completeWithStop (1303.39s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	1307.404s
GovCloud
% make testacc TESTARGS='-run=TestAccAwsAppStreamFleet_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccAwsAppStreamFleet_ -timeout 180m
=== RUN   TestAccAwsAppStreamFleet_basic
=== PAUSE TestAccAwsAppStreamFleet_basic
=== RUN   TestAccAwsAppStreamFleet_disappears
=== PAUSE TestAccAwsAppStreamFleet_disappears
=== RUN   TestAccAwsAppStreamFleet_completeWithStop
=== PAUSE TestAccAwsAppStreamFleet_completeWithStop
=== RUN   TestAccAwsAppStreamFleet_completeWithoutStop
=== PAUSE TestAccAwsAppStreamFleet_completeWithoutStop
=== RUN   TestAccAwsAppStreamFleet_withTags
=== PAUSE TestAccAwsAppStreamFleet_withTags
=== CONT  TestAccAwsAppStreamFleet_basic
=== CONT  TestAccAwsAppStreamFleet_completeWithoutStop
=== CONT  TestAccAwsAppStreamFleet_withTags
=== CONT  TestAccAwsAppStreamFleet_completeWithStop
=== CONT  TestAccAwsAppStreamFleet_disappears
=== CONT  TestAccAwsAppStreamFleet_basic
    provider_test.go:1123: skipping test for aws-us-gov/us-gov-west-1: Error running apply: exit status 1
        
        Error: error creating Appstream Fleet (): ResourceNotFoundException: The image Amazon-AppStream2-Sample-Image-02-04-2019 for account 357342307427  does not exist.
        
          with aws_appstream_fleet.test,
          on terraform_plugin_test.tf line 2, in resource "aws_appstream_fleet" "test":
           2: resource "aws_appstream_fleet" "test" {
        
--- SKIP: TestAccAwsAppStreamFleet_basic (908.76s)
=== CONT  TestAccAwsAppStreamFleet_disappears
    provider_test.go:1123: skipping test for aws-us-gov/us-gov-west-1: Error running apply: exit status 1
        
        Error: error creating Appstream Fleet (): ResourceNotFoundException: The image Amazon-AppStream2-Sample-Image-02-04-2019 for account 357342307427  does not exist.
        
          with aws_appstream_fleet.test,
          on terraform_plugin_test.tf line 2, in resource "aws_appstream_fleet" "test":
           2: resource "aws_appstream_fleet" "test" {
        
--- SKIP: TestAccAwsAppStreamFleet_disappears (908.98s)
=== CONT  TestAccAwsAppStreamFleet_withTags
    provider_test.go:1123: skipping test for aws-us-gov/us-gov-west-1: Error running apply: exit status 1
        
        Error: error creating Appstream Fleet (): ResourceNotFoundException: The image Amazon-AppStream2-Sample-Image-02-04-2019 for account 357342307427  does not exist.
        
          with aws_appstream_fleet.test,
          on terraform_plugin_test.tf line 22, in resource "aws_appstream_fleet" "test":
          22: resource "aws_appstream_fleet" "test" {
        
=== CONT  TestAccAwsAppStreamFleet_completeWithoutStop
    provider_test.go:1123: skipping test for aws-us-gov/us-gov-west-1: Error running apply: exit status 1
        
        Error: error creating Appstream Fleet (): ResourceNotFoundException: The image Amazon-AppStream2-Sample-Image-02-04-2019 for account 357342307427  does not exist.
        
          with aws_appstream_fleet.test,
          on terraform_plugin_test.tf line 22, in resource "aws_appstream_fleet" "test":
          22: resource "aws_appstream_fleet" "test" {
        
=== CONT  TestAccAwsAppStreamFleet_completeWithStop
    provider_test.go:1123: skipping test for aws-us-gov/us-gov-west-1: Error running apply: exit status 1
        
        Error: error creating Appstream Fleet (): ResourceNotFoundException: The image Amazon-AppStream2-Sample-Image-02-04-2019 for account 357342307427  does not exist.
        
          with aws_appstream_fleet.test,
          on terraform_plugin_test.tf line 22, in resource "aws_appstream_fleet" "test":
          22: resource "aws_appstream_fleet" "test" {
        
--- SKIP: TestAccAwsAppStreamFleet_completeWithStop (920.31s)
--- SKIP: TestAccAwsAppStreamFleet_completeWithoutStop (920.32s)
--- SKIP: TestAccAwsAppStreamFleet_withTags (920.36s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	924.802s

@ewbankkit
Copy link
Contributor

@coderGo93 Thanks for the contribution 🎉 👏.

@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
service/appstream Issues and PRs that pertain to the appstream service. size/L 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.

AppStream Fleet Timeout Instead of Create Error AppStream Resources Need Sweepers
3 participants