From 33d01a2ba282ed0a787ae276f958d4a2a9688170 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Thu, 27 Sep 2018 16:37:01 -0700 Subject: [PATCH] core: Fix TestContext2Apply_moduleOrphanGrandchildProvider One of the assumptions this test was checking no longer holds: we don't retain outputs for non-root modules in persistent state, because we can always re-populate these on a future run by evaluating the configuration. --- terraform/context_apply_test.go | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/terraform/context_apply_test.go b/terraform/context_apply_test.go index a6e048ee9..376caee66 100644 --- a/terraform/context_apply_test.go +++ b/terraform/context_apply_test.go @@ -2918,6 +2918,7 @@ func TestContext2Apply_moduleOrphanGrandchildProvider(t *testing.T) { Primary: &InstanceState{ ID: "bar", }, + Provider: "provider.aws", }, }, }, @@ -8321,20 +8322,16 @@ func TestContext2Apply_targetedModuleUnrelatedOutputs(t *testing.T) { t.Fatalf("diags: %s", diags.Err()) } - // module.child1's instance_id output should be retained from state - // module.child2's instance_id is updated because its dependency is updated - // child2_id is updated because if its transitive dependency via module.child2 + // - module.child1's instance_id output is dropped because we don't preserve + // non-root module outputs between runs (they can be recalculated from config) + // - module.child2's instance_id is updated because its dependency is updated + // - child2_id is updated because if its transitive dependency via module.child2 checkStateString(t, state, ` Outputs: child2_id = foo -module.child1: - - Outputs: - - instance_id = foo-bar-baz module.child2: aws_instance.foo: ID = foo