Skip to content

terraform test: support nested collection mock values - #38947

Closed
maithilijoshi20 wants to merge 1 commit into
hashicorp:mainfrom
maithilijoshi20:fix-nested-type-collection-mocks
Closed

terraform test: support nested collection mock values#38947
maithilijoshi20 wants to merge 1 commit into
hashicorp:mainfrom
maithilijoshi20:fix-nested-type-collection-mocks

Conversation

@maithilijoshi20

@maithilijoshi20 maithilijoshi20 commented Jul 30, 2026

Copy link
Copy Markdown

Problem

override_data values for Plugin Framework nested_type list and set attributes are represented as HCL tuples. Terraform rejected them before coercing them to the provider schema, so terraform test could not use these overrides.

Change

Nested single and group attributes still require object values. Nested list, set, and map attributes now use the existing collection conversion path with the nested schema ConfigType, which converts supported collection values and fills nested objects.

Tests

  • go test ./internal/moduletest/mocking — passed

Focused regression coverage exercises a data-source override containing an HCL tuple for a nested list attribute, as well as list, set, and map conversion cases.

Not run: the full Terraform test suite.

Notes

Object inputs for nested collection attributes retain the existing empty-collection element-template behavior.

Fixes #38369.

Changelog

Included a 1.17 bug-fix entry.

@maithilijoshi20
maithilijoshi20 requested a review from a team as a code owner July 30, 2026 05:27
@hashicorp-cla-app

hashicorp-cla-app Bot commented Jul 30, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@maithilijoshi20
maithilijoshi20 force-pushed the fix-nested-type-collection-mocks branch from b88c4d6 to d859f62 Compare July 30, 2026 05:28
@maithilijoshi20
maithilijoshi20 force-pushed the fix-nested-type-collection-mocks branch from d859f62 to 903ab60 Compare July 30, 2026 05:32
@crw

crw commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Thanks for your submission. Please see Contributing.md, particularly the sections on Proposing a Change and AI Usage. Thank you.

@crw crw closed this Jul 30, 2026
@crw crw added the bug label Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

terraform test: override_data fails with nested_type attributes (Plugin Framework providers)

2 participants