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

SDKv2 ImportState and ExpectError Test Failures #14801

Closed
bflad opened this issue Aug 24, 2020 · 2 comments
Closed

SDKv2 ImportState and ExpectError Test Failures #14801

bflad opened this issue Aug 24, 2020 · 2 comments
Labels
technical-debt Addresses areas of the codebase that need refactoring or redesign. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. upstream-terraform Addresses functionality related to the Terraform core binary.

Comments

@bflad
Copy link
Contributor

bflad commented Aug 24, 2020

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue 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 issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

There are currently issues with Terraform Plugin SDK version 2 when an acceptance testing step includes both ImportState and ExpectError, where the newer version does not honor the check against the expected error. This has historically been used for verify that incorrect import identifiers trigger an appropriate error.

Some examples include:

=== CONT  TestAccAWSAutoscalingSchedule_basic
TestAccAWSAutoscalingSchedule_basic: testing_new_import_state.go:74: failed to import: terraform failed: exit status 1
stderr:
Error: Cannot import non-existent remote object
While attempting to import an existing object to
aws_autoscaling_schedule.foobar, the provider detected that no object exists
with the given id. Only pre-existing objects can be imported; check that the
id is correct and that it is associated with the provider's configured region
or endpoint, or use "terraform apply" to create a new remote object for this
resource.
--- FAIL: TestAccAWSAutoscalingSchedule_basic (193.36s)

=== CONT  TestAccAWSEcsService_basicImport
TestAccAWSEcsService_basicImport: testing_new_import_state.go:74: failed to import: terraform failed: exit status 1
stderr:
Error: Cannot import non-existent remote object
While attempting to import an existing object to aws_ecs_service.jenkins, the
provider detected that no object exists with the given id. Only pre-existing
objects can be imported; check that the id is correct and that it is
associated with the provider's configured region or endpoint, or use
"terraform apply" to create a new remote object for this resource.
--- FAIL: TestAccAWSEcsService_basicImport (95.53s)

=== CONT  TestAccAWSKinesisFirehoseDeliveryStream_basic
    TestAccAWSKinesisFirehoseDeliveryStream_basic: testing_new_import_state.go:74: failed to import: terraform failed: exit status 1

        stderr:

        Error: Expected ID in format of arn:PARTITION:firehose:REGION:ACCOUNTID:deliverystream/NAME and provided: just-a-name



--- FAIL: TestAccAWSKinesisFirehoseDeliveryStream_basic (101.43s)

Affected Tests

  • TestAccAWSAutoscalingSchedule_basic
  • TestAccAWSEcsService_basicImport
  • TestAccAWSKinesisFirehoseDeliveryStream_basic

References

@bflad bflad added upstream-terraform Addresses functionality related to the Terraform core binary. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. technical-debt Addresses areas of the codebase that need refactoring or redesign. labels Aug 24, 2020
@bflad bflad added this to the Roadmap milestone Aug 24, 2020
bflad pushed a commit that referenced this issue Aug 31, 2020
…iguration cluster_endpoint argument + other plan-time validations (#12484)

Output from acceptance testing (failure related to #14801, which is pending SDK release):

```
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3_DataFormatConversionConfiguration_HiveJsonSerDe_Empty (117.70s)
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_s3KinesisStreamSource (120.98s)
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_s3basic (138.97s)
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3_ExternalUpdate (139.32s)
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3_DataFormatConversionConfiguration_ParquetSerDe_Empty (147.64s)
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_s3WithCloudwatchLogging (151.49s)
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_disappears (163.31s)
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3_ErrorOutputPrefix (168.98s)
--- FAIL: TestAccAWSKinesisFirehoseDeliveryStream_basic (170.08s)
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3KmsKeyArn (178.69s)
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3_ProcessingConfiguration_Empty (182.19s)
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3_DataFormatConversionConfiguration_OpenXJsonSerDe_Empty (182.93s)
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3_DataFormatConversionConfiguration_OrcSerDe_Empty (183.27s)
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3basic (188.71s)
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3_DataFormatConversionConfiguration_Deserializer_Update (193.04s)
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3_DataFormatConversionConfiguration_Serializer_Update (196.71s)
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3_DataFormatConversionConfiguration_Enabled (196.89s)
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_s3basicWithTags (205.97s)
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3_KinesisStreamSource (99.58s)
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_s3basicWithSSE (248.87s)
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_s3ConfigUpdates (263.69s)
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_ExtendedS3Updates (169.93s)
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_SplunkConfigUpdates (161.74s)
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_missingProcessingConfiguration (133.82s)
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_RedshiftConfigUpdates (512.06s)
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_ElasticsearchConfigUpdates (753.17s)
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_ElasticsearchConfigEndpointUpdates (753.32s)
--- PASS: TestAccAWSKinesisFirehoseDeliveryStream_ElasticsearchWithVpcConfigUpdates (1437.39s)
```
@bflad
Copy link
Contributor Author

bflad commented Oct 12, 2020

Fixed with Terraform Plugin SDK v2.0.4. 👍

@bflad bflad closed this as completed Oct 12, 2020
@ghost
Copy link

ghost commented Nov 12, 2020

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 Nov 12, 2020
@breathingdust breathingdust removed this from the Roadmap milestone Nov 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
technical-debt Addresses areas of the codebase that need refactoring or redesign. tests PRs: expanded test coverage. Issues: expanded coverage, enhancements to test infrastructure. upstream-terraform Addresses functionality related to the Terraform core binary.
Projects
None yet
Development

No branches or pull requests

2 participants