Support referencing modules with dynamic sources in Terraform Test - #38950
Open
dbanck wants to merge 6 commits into
Open
Support referencing modules with dynamic sources in Terraform Test#38950dbanck wants to merge 6 commits into
dbanck wants to merge 6 commits into
Conversation
dbanck
force-pushed
the
dbanck/dynamic-test-support
branch
from
July 30, 2026 14:14
81585da to
5087006
Compare
dbanck
marked this pull request as ready for review
July 30, 2026 14:29
dbanck
force-pushed
the
dbanck/dynamic-test-support
branch
from
July 30, 2026 14:30
5087006 to
1d6d7eb
Compare
This prefix can be used to install test configurations under specific paths.
Instead of calling buildTestModules as part of FinalizeConfig, we now do this as part of the init graph. This allows us to reuse the existing module resolution logic for test modules as well. The legacy finalize config method can be removed as part of removing BuildConfig.
This slowly gets rid of the legacy module installer calls without an initializer. Which will allow us to remove installDescendantModules at some point.
dbanck
force-pushed
the
dbanck/dynamic-test-support
branch
from
July 31, 2026 15:37
1d6d7eb to
f608c50
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR updates the way we load modules in Terraform Test. Instead of calling
buildTestModulesas part ofFinalizeConfig, we now do this as part of the init graph. This allows us to reuse the existing module resolution logic for test modules as well.We gather the values for the const variables from *.tfvars and CLI sources. This approach currently does NOT support supplying values for const variables via
variablesblocks inside test files. Supporting these would require another resolution step, since the variable expressions can contain references. As const variables need to remain constant throughout all test runs (otherwise you would need to runinitagain), it needs to be assessed whether supportingvariablesis necessary.There is still some legacy code around
BuildConfigin place and I'm planning to remove it in a follow-up PR.Fixes #38788
Target Release
1.16.x
Rollback Plan
Changes to Security Controls
Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.
CHANGELOG entry