Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add framework function object parameter attribute requiredness tests (#…
…226) Reference: hashicorp/terraform-plugin-framework#955 This adds acceptance tests that capture the linked issue around object parameter attribute requiredness with the existing behavior of Terraform and available functionality of the framework. These are being added as regression checks should framework functionality ever be introduced that either automatically or enables developers to make object attributes optional. It should be considered a breaking change should the existing function definition begin not causing an error, as provider developers may be reliant and desire this existing behavior for their use cases. Without `ErrorCheck` (and temporarily `TerraformVersionChecks` to workaround prerelease issues): ``` === CONT TestObjectFunction_Known_AttributeRequired_Error object_function_test.go:53: Step 1/1 error: Error running pre-apply plan: exit status 1 Error: Invalid function argument on terraform_plugin_test.tf line 13, in output "test": 13: value = provider::framework::object({ 14: "attr1" = "value1", 15: }) ├──────────────── │ while calling provider::framework::object(param1) Invalid value for "param1" parameter: attribute "attr2" is required. --- FAIL: TestObjectFunction_Known_AttributeRequired_Error (0.30s) ``` With `ErrorCheck`: ``` --- PASS: TestObjectFunction_Known_AttributeRequired_Error (0.48s) --- PASS: TestObjectFunction_Known_AttributeRequired_Null (0.53s) ```
- Loading branch information