-
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.
allow mocked values override during planning
- Loading branch information
Showing
5 changed files
with
76 additions
and
6 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
25 changes: 25 additions & 0 deletions
25
internal/command/testdata/test/mocking-error/tests/plan_mocked_provider.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,25 @@ | ||
mock_provider "test" { | ||
alias = "secondary" | ||
|
||
mock_resource "test_resource" { | ||
defaults = { | ||
id = "ffff" | ||
} | ||
} | ||
} | ||
|
||
|
||
variables { | ||
instances = 2 | ||
child_instances = 1 | ||
} | ||
|
||
run "test" { | ||
command = plan | ||
|
||
assert { | ||
condition = test_resource.secondary[0].id == "ffff" | ||
error_message = "plan should use the mocked provider value when override_computed is true" | ||
} | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
internal/command/testdata/test/mocking/tests/plan_mocked_provider.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,26 @@ | ||
mock_provider "test" { | ||
alias = "secondary" | ||
override_computed = true | ||
|
||
mock_resource "test_resource" { | ||
defaults = { | ||
id = "ffff" | ||
} | ||
} | ||
} | ||
|
||
|
||
variables { | ||
instances = 2 | ||
child_instances = 1 | ||
} | ||
|
||
run "test" { | ||
command = plan | ||
|
||
assert { | ||
condition = test_resource.secondary[0].id == "ffff" | ||
error_message = "plan should use the mocked provider value when override_computed is true" | ||
} | ||
|
||
} |
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