Closed YakDriver closed 3 years ago
tfproviderlint
has a new check, XAT001
, which can detect this automatically:
...
Error: /home/runner/work/terraform-provider-aws/terraform-provider-aws/aws/data_source_aws_acm_certificate_test.go:38:36: XAT001: missing ErrorCheck
37
38 resource.ParallelTest(t, resource.TestCase{
39 PreCheck: func() { testAccPreCheck(t) },
Error: /home/runner/work/terraform-provider-aws/terraform-provider-aws/aws/data_source_aws_acm_certificate_test.go:110:36: XAT001: missing ErrorCheck
109
110 resource.ParallelTest(t, resource.TestCase{
111 PreCheck: func() { testAccPreCheck(t) },
Error: /home/runner/work/terraform-provider-aws/terraform-provider-aws/aws/data_source_aws_acm_certificate_test.go:158:36: XAT001: missing ErrorCheck
157
158 resource.ParallelTest(t, resource.TestCase{
159 PreCheck: func() { testAccPreCheck(t) },
Error: /home/runner/work/terraform-provider-aws/terraform-provider-aws/aws/data_source_aws_acm_certificate_test.go:197:36: XAT001: missing ErrorCheck
196
197 resource.ParallelTest(t, resource.TestCase{
198 PreCheck: func() { testAccPreCheck(t) },
Error: /home/runner/work/terraform-provider-aws/terraform-provider-aws/aws/data_source_aws_acmpca_certificate_authority_test.go:14:36: XAT001: missing ErrorCheck
13
14 resource.ParallelTest(t, resource.TestCase{
15 PreCheck: func() { testAccPreCheck(t) },
...
It will remain disabled in our makefile until we are ready.
Cool! Thanks. We have a lot of data sources and resources!
This has been released in version 3.34.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!
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!
Community Note
Description
To facilitate running acceptance tests across partitions, tests should include an
ErrorCheck
.ErrorCheck
will skip tests if they fail for unsupported features rather than code problems. See the Contributing Guide for more information.Definition of Done
PreCheck
also have anErrorCheck
:ErrorCheck
with tfproviderlint/XAT001 (#18309)References
17566
18057
18059