-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
terraform test: Collect variables from default var file within testing directory #34341
Conversation
Co-authored-by: Liam Cervante <liam.cervante@hashicorp.com>
Co-authored-by: Liam Cervante <liam.cervante@hashicorp.com>
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.
I think this looks good now!
@JKIPIKA, do you want to take a look at the commit I made and make sure you're happy with it and understand everything? Since it'll be your name associated with the final merge, I wanted to give you a chance to raise any concerns.
Once you've confirmed you're happy with everything, I can approve and merge!
Thanks so much for your work on this!
if path.Dir(file.Name) == runner.Suite.TestingDirectory { | ||
// If the file is in the testing directory, then also include any | ||
// variables that are defined within the default variable file also in | ||
// the test directory. | ||
for name, value := range runner.Suite.GlobalTestVariables { | ||
runner.globalVariables[name] = value | ||
} | ||
} |
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.
@JKIPIKA, I resolved the diffs by undoing your changes to the other function and adding the relevant change directly in here instead.
You didn't do anything wrong, this function isn't available within the v1.6 branch so you did the right thing in your original PR. It's just we will have introduced this function at some point after the v1.6 launch for managing the global variables and it's much easier to add here.
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.
Ah I get it now, thanks for explanation!
@liamcervante, I checked your commit, I can see that you moved my logic into |
Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch. |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
This is a duplicate of #34276 for the merge to the main branch