hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.74k stars 9.1k forks source link

[Tech Debt]: `codepipeline` tests failing with panic #32577

Closed jar-b closed 1 year ago

jar-b commented 1 year ago

Description

Several codepipeline acceptance tests are crashing during test PreChecks.

make testacc PKG=codepipeline TESTS=TestAccCodePipeline_basic
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/codepipeline/... -v -count 1 -parallel 20 -run='TestAccCodePipeline_basic'  -timeout 180m
=== RUN   TestAccCodePipeline_basic
=== PAUSE TestAccCodePipeline_basic
=== CONT  TestAccCodePipeline_basic
--- FAIL: TestAccCodePipeline_basic (0.88s)
panic: unknown service package: codepipeline [recovered]
        panic: unknown service package: codepipeline

goroutine 10 [running]:
testing.tRunner.func1.2({0x110c2e820, 0x140032f6800})
        /opt/homebrew/Cellar/go/1.20.5/libexec/src/testing/testing.go:1526 +0x1c8
testing.tRunner.func1()
        /opt/homebrew/Cellar/go/1.20.5/libexec/src/testing/testing.go:1529 +0x384
panic({0x110c2e820, 0x140032f6800})
        /opt/homebrew/Cellar/go/1.20.5/libexec/src/runtime/panic.go:884 +0x204
github.com/hashicorp/terraform-provider-aws/internal/errs.Must[...](...)
        /Users/jaredbaker/development/terraform-provider-aws/internal/errs/must.go:13
github.com/hashicorp/terraform-provider-aws/internal/conns.(*AWSClient).CodePipelineConn(0x14003187608?, {0x112ccc700?, 0x140031116e0?})
        /Users/jaredbaker/development/terraform-provider-aws/internal/conns/awsclient_gen.go:569 +0x60
github.com/hashicorp/terraform-provider-aws/internal/service/codepipeline_test.testAccPreCheckSupported({0x112ccc700, 0x140031116e0}, 0x1400311e820, {0x0, 0x0, 0x0})
        /Users/jaredbaker/development/terraform-provider-aws/internal/service/codepipeline/codepipeline_test.go:678 +0x1b8
github.com/hashicorp/terraform-provider-aws/internal/service/codepipeline_test.TestAccCodePipeline_basic.func1()
        /Users/jaredbaker/development/terraform-provider-aws/internal/service/codepipeline/codepipeline_test.go:34 +0x50
github.com/hashicorp/terraform-plugin-testing/helper/resource.Test({0x112ceea60, 0x1400311e820}, {0x0, 0x140030e7ee0, {0x0, 0x0, 0x0}, 0x0, 0x140008b3320, 0x0, ...})
        /Users/jaredbaker/go/pkg/mod/github.com/hashicorp/terraform-plugin-testing@v1.3.0/helper/resource/testing.go:817 +0x384
github.com/hashicorp/terraform-plugin-testing/helper/resource.ParallelTest({0x112ceea60, 0x1400311e820}, {0x0, 0x140030e7ee0, {0x0, 0x0, 0x0}, 0x0, 0x140008b3320, 0x0, ...})
        /Users/jaredbaker/go/pkg/mod/github.com/hashicorp/terraform-plugin-testing@v1.3.0/helper/resource/testing.go:737 +0x70
github.com/hashicorp/terraform-provider-aws/internal/service/codepipeline_test.TestAccCodePipeline_basic(0x1400311e820)
        /Users/jaredbaker/development/terraform-provider-aws/internal/service/codepipeline/codepipeline_test.go:31 +0x11ec
testing.tRunner(0x1400311e820, 0x112b9a9c8)
        /opt/homebrew/Cellar/go/1.20.5/libexec/src/testing/testing.go:1576 +0x10c
created by testing.(*T).Run
        /opt/homebrew/Cellar/go/1.20.5/libexec/src/testing/testing.go:1629 +0x368
FAIL    github.com/hashicorp/terraform-provider-aws/internal/service/codepipeline       4.100s
FAIL
make: *** [testacc] Error 1

This appears to be caused by the PreCheck passing a plan AWSClient struct to the ConfigureProvider method.

https://github.com/hashicorp/terraform-provider-aws/blob/e7b77669866cbb150c834594fe823a9ebc0a281b/internal/service/codepipeline/codepipeline_test.go#L669-L673

References

No response

Would you like to implement a fix?

None

github-actions[bot] commented 1 year ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

github-actions[bot] commented 1 year ago

This functionality has been released in v5.9.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. Thank you!

github-actions[bot] commented 1 year ago

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.