-
Notifications
You must be signed in to change notification settings - Fork 9.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
terraform test: Fix crash when referencing variables within the file …
…level variable block
- Loading branch information
1 parent
8da1c00
commit c953a28
Showing
5 changed files
with
52 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
6 changes: 6 additions & 0 deletions
6
internal/command/testdata/test/global_var_refs/environment_variable.tftest.hcl
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
variables { | ||
input = var.env_var_input | ||
} | ||
|
||
run "execute" {} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
variable "input" { | ||
type = string | ||
} | ||
|
||
output "value" { | ||
value = var.input | ||
} |
17 changes: 17 additions & 0 deletions
17
internal/command/testdata/test/global_var_refs/run_block_output.tftest.hcl
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
|
||
variables { | ||
input = var.setup.value | ||
} | ||
|
||
run "setup" { | ||
variables { | ||
input = "hello" | ||
} | ||
} | ||
|
||
run "execute" { | ||
assert { | ||
condition = output.value == "hello" | ||
error_message = "bad output value" | ||
} | ||
} |