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:
Martin Atkins 2018-05-21 11:32:43 -07:00
parent 6bf70427dd
commit e528fe50e9
5 changed files with 274 additions and 253 deletions

File diff suppressed because it is too large Load Diff

View File

@ -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
// in a JSON file so that we can load them below.
diags := loader.InstallModules(cfgPath, true, configload.InstallHooksImpl{})
t.Fatal(diags.Error())
if diags.HasErrors() {
t.Fatal(diags.Error())
}
config, diags := loader.LoadConfig(cfgPath)
if diags.HasErrors() {

View File

@ -1,7 +1,7 @@
resource "aws_instance" "foo" {
count = 2
num = "2"
compute = "${element(data.aws_vpc.bar.*.id, count.index)}"
compute = data.aws_vpc.bar[count.index].id
lifecycle {
create_before_destroy = true

View File

@ -1,9 +1,9 @@
module "mod1" {
source = "mod"
source = "./mod"
param = ["this", "one", "works"]
}
module "mod2" {
source = "mod"
source = "./mod"
param = ["${module.mod1.out_from_splat[0]}"]
}

View File

@ -1,5 +1,5 @@
locals {
"one" = 1
one = 1
}
resource "aws_instance" "a" {