diff --git a/terraform/context_apply_test.go b/terraform/context_apply_test.go index b5700e715..5f602c387 100644 --- a/terraform/context_apply_test.go +++ b/terraform/context_apply_test.go @@ -4110,7 +4110,7 @@ func TestContext2Apply_outputOrphanModule(t *testing.T) { actual = strings.TrimSpace(state.String()) if actual != "" { - t.Fatalf("wrong result\n\ngot:\n%s\n\nwant: no state at all", actual) + t.Fatalf("expected no state, got:\n%s", actual) } } @@ -5247,9 +5247,9 @@ func TestContext2Apply_provisionerDestroyRef(t *testing.T) { p.ApplyFn = testApplyFn p.DiffFn = testDiffFn pr.ApplyFn = func(rs *InstanceState, c *ResourceConfig) error { - val, ok := c.Config["foo"] + val, ok := c.Config["command"] if !ok || val != "hello" { - return fmt.Errorf("bad value for foo: %v %#v", val, c) + return fmt.Errorf("bad value for command: %v %#v", val, c) } return nil @@ -5265,9 +5265,10 @@ func TestContext2Apply_provisionerDestroyRef(t *testing.T) { Primary: &InstanceState{ ID: "bar", Attributes: map[string]string{ - "key": "hello", + "value": "hello", }, }, + Provider: "provider.aws", }, "aws_instance.foo": &ResourceState{ @@ -5275,6 +5276,7 @@ func TestContext2Apply_provisionerDestroyRef(t *testing.T) { Primary: &InstanceState{ ID: "bar", }, + Provider: "provider.aws", }, }, }, diff --git a/terraform/test-fixtures/apply-provisioner-destroy-ref/main.tf b/terraform/test-fixtures/apply-provisioner-destroy-ref/main.tf index 01561a516..b36916df1 100644 --- a/terraform/test-fixtures/apply-provisioner-destroy-ref/main.tf +++ b/terraform/test-fixtures/apply-provisioner-destroy-ref/main.tf @@ -1,12 +1,12 @@ resource "aws_instance" "bar" { - key = "hello" + value = "hello" } resource "aws_instance" "foo" { foo = "bar" provisioner "shell" { - foo = "${aws_instance.bar.key}" + command = "${aws_instance.bar.value}" when = "destroy" } }