-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
tests/resource/aws_elastic_beanstalk_environment: Refactoring and modernization #11702
tests/resource/aws_elastic_beanstalk_environment: Refactoring and modernization #11702
Conversation
…ernization Previously in the acceptance testing (across entire resource): ``` --- FAIL: TestAccAWSBeanstalkEnv_basic (20.78s) testing.go:640: Step 0 error: errors during apply: Error: Error waiting for Elastic Beanstalk Environment (e-mua2t3mjij) to become ready: 2 errors occurred: * 2020-01-21 07:33:24.327 +0000 UTC (e-mua2t3mjij) : Service:AmazonCloudFormation, Message:Parameter InstanceType failed to satisfy constraint: must be a valid EC2 instance type. * 2020-01-21 07:33:24.426 +0000 UTC (e-mua2t3mjij) : Failed to launch environment. --- FAIL: TestAccAWSBeanstalkEnv_settingWithJsonValue (0.73s) testing.go:640: Step 0 error: /opt/teamcity-agent/temp/buildTmp/tf-test536039886/main.tf:74,3-10: Attribute redefined; The argument "setting" was already set at /opt/teamcity-agent/temp/buildTmp/tf-test536039886/main.tf:68,3-10. Each argument may be set only once., and 19 other diagnostic(s) ``` The test configurations were previously written to expect either a Elastic Beanstalk compatible Default VPC (IGW, map public IPs on launch Subnets, and permissive ingress/egress NACL) or EC2-Classic. We have moved away from these expectations and the majority of this refactor is centered on supplying self-contained VPC configurations to each test. Other changes include: - Blocking usw2-az4 as the default instance type for EB is t2.micro and that instance type is not available in that Availability Zone, always (when that subnet is selected) triggering a launch error - Migrating to import testing in most tests - Migrating to resources named "test" in configurations and single resourceName variable in functions - Migrating to single rName variable for randomization - Using helper TestCheckFunc for ARNs - Removing duplicate test functions and configurations Especially given the new import testing, there are potential further fixes that could be done to this resource including properly setting the `setting` and `template_name` attributes into the Terraform state during refresh, however those changes to the resource logic are out of scope for these test fixes. Output from acceptance testing: ``` --- PASS: TestAccAWSBeanstalkEnv_platformArn (410.22s) --- PASS: TestAccAWSBeanstalkEnv_resource (439.66s) --- PASS: TestAccAWSBeanstalkEnv_basic (489.82s) --- PASS: TestAccAWSBeanstalkEnv_settingWithJsonValue (558.85s) --- PASS: TestAccAWSBeanstalkEnv_cname_prefix (577.42s) --- PASS: TestAccAWSBeanstalkEnv_version_label (618.65s) --- PASS: TestAccAWSBeanstalkEnv_config (628.04s) --- PASS: TestAccAWSBeanstalkEnv_tier (630.63s) --- PASS: TestAccAWSBeanstalkEnv_tags (667.96s) --- PASS: TestAccAWSBeanstalkEnv_settings_update (744.56s) --- PASS: TestAccAWSBeanstalkEnv_template_change (768.69s) ```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚀
--- PASS: TestProvider_impl (0.10s)
--- PASS: TestProvider (0.90s)
--- PASS: TestAccAWSProvider_Region_AwsGovCloudUs (15.35s)
--- PASS: TestAccAWSProvider_Region_AwsCommercial (15.79s)
--- PASS: TestAccAWSProvider_Region_AwsChina (15.55s)
--- PASS: TestAccAWSProvider_IgnoreTagPrefixes_One (16.51s)
--- PASS: TestAccAWSProvider_IgnoreTagPrefixes_Multiple (16.55s)
--- PASS: TestAccAWSProvider_IgnoreTags_Multiple (16.53s)
--- PASS: TestAccAWSProvider_IgnoreTagPrefixes_None (16.96s)
--- PASS: TestAccAWSProvider_IgnoreTags_None (16.92s)
--- PASS: TestAccAWSProvider_IgnoreTags_One (17.18s)
--- PASS: TestAccAWSProvider_Endpoints_Deprecated (17.43s)
--- PASS: TestAccAWSProvider_Endpoints (17.50s)
--- PASS: TestAccAWSBeanstalkEnv_cname_prefix (339.88s)
--- PASS: TestAccAWSBeanstalkEnv_basic (390.06s)
--- PASS: TestAccAWSBeanstalkEnv_settingWithJsonValue (461.63s)
--- PASS: TestAccAWSBeanstalkEnv_resource (570.10s)
--- PASS: TestAccAWSBeanstalkEnv_tier (616.26s)
--- PASS: TestAccAWSBeanstalkEnv_version_label (616.69s)
--- PASS: TestAccAWSBeanstalkEnv_tags (624.32s)
--- PASS: TestAccAWSBeanstalkEnv_config (650.68s)
--- PASS: TestAccAWSBeanstalkEnv_template_change (660.97s)
--- PASS: TestAccAWSBeanstalkEnv_platformArn (790.99s)
--- PASS: TestAccAWSBeanstalkEnv_settings_update (870.54s)
This has been released in version 2.48.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
Release note for CHANGELOG:
Previously in the acceptance testing (across entire resource):
The test configurations were previously written to expect either a Elastic Beanstalk compatible Default VPC (IGW, map public IPs on launch Subnets, and permissive ingress/egress NACL) or EC2-Classic. We have moved away from these expectations and the majority of this refactor is centered on supplying self-contained VPC configurations to each test.
Other changes include:
Especially given the new import testing, there are potential further fixes that could be done to this resource including properly setting the
setting
andtemplate_name
attributes into the Terraform state during refresh, however those changes to the resource logic are out of scope for these test fixes.Output from acceptance testing: