core: Misc. updates to the "plan" context tests
Mostly this is about updating ctx.Plan callers to expect diags instead of err, but also includes a few light updates to test fixtures, and a fix to testModuleInline.
This commit is contained in:
parent
6bf70427dd
commit
e528fe50e9
File diff suppressed because it is too large
Load Diff
|
@ -146,7 +146,9 @@ func testModuleInline(t *testing.T, sources map[string]string) *configs.Config {
|
||||||
// sources only this ultimately just records all of the module paths
|
// sources only this ultimately just records all of the module paths
|
||||||
// in a JSON file so that we can load them below.
|
// in a JSON file so that we can load them below.
|
||||||
diags := loader.InstallModules(cfgPath, true, configload.InstallHooksImpl{})
|
diags := loader.InstallModules(cfgPath, true, configload.InstallHooksImpl{})
|
||||||
t.Fatal(diags.Error())
|
if diags.HasErrors() {
|
||||||
|
t.Fatal(diags.Error())
|
||||||
|
}
|
||||||
|
|
||||||
config, diags := loader.LoadConfig(cfgPath)
|
config, diags := loader.LoadConfig(cfgPath)
|
||||||
if diags.HasErrors() {
|
if diags.HasErrors() {
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
resource "aws_instance" "foo" {
|
resource "aws_instance" "foo" {
|
||||||
count = 2
|
count = 2
|
||||||
num = "2"
|
num = "2"
|
||||||
compute = "${element(data.aws_vpc.bar.*.id, count.index)}"
|
compute = data.aws_vpc.bar[count.index].id
|
||||||
|
|
||||||
lifecycle {
|
lifecycle {
|
||||||
create_before_destroy = true
|
create_before_destroy = true
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
module "mod1" {
|
module "mod1" {
|
||||||
source = "mod"
|
source = "./mod"
|
||||||
param = ["this", "one", "works"]
|
param = ["this", "one", "works"]
|
||||||
}
|
}
|
||||||
|
|
||||||
module "mod2" {
|
module "mod2" {
|
||||||
source = "mod"
|
source = "./mod"
|
||||||
param = ["${module.mod1.out_from_splat[0]}"]
|
param = ["${module.mod1.out_from_splat[0]}"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
locals {
|
locals {
|
||||||
"one" = 1
|
one = 1
|
||||||
}
|
}
|
||||||
|
|
||||||
resource "aws_instance" "a" {
|
resource "aws_instance" "a" {
|
||||||
|
|
Loading…
Reference in New Issue