From 4dd4b721ac0c9c0e545bfc715ba799d8d9ead447 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Thu, 27 Sep 2018 15:58:38 -0700 Subject: [PATCH] core: Fix TestContext2Apply_moduleOrphanInheritAlias The old-fashioned formatting of "Provider" on the shimmed state here was causing the state upgrade code to treat it like a module-relative address, rather than an absolute address as we now expect. --- terraform/context_apply_test.go | 4 ++-- .../apply-module-provider-inherit-alias-orphan/main.tf | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/terraform/context_apply_test.go b/terraform/context_apply_test.go index 74e7378ea..a9c8deccb 100644 --- a/terraform/context_apply_test.go +++ b/terraform/context_apply_test.go @@ -2809,7 +2809,7 @@ func TestContext2Apply_moduleOrphanInheritAlias(t *testing.T) { Primary: &InstanceState{ ID: "bar", }, - Provider: "aws.eu", + Provider: "provider.aws.eu", }, }, }, @@ -2839,7 +2839,7 @@ func TestContext2Apply_moduleOrphanInheritAlias(t *testing.T) { t.Fatal("must call configure") } - checkStateString(t, state, "") + checkStateString(t, state, "") } func TestContext2Apply_moduleOrphanProvider(t *testing.T) { diff --git a/terraform/test-fixtures/apply-module-provider-inherit-alias-orphan/main.tf b/terraform/test-fixtures/apply-module-provider-inherit-alias-orphan/main.tf index d41436803..4332b9adb 100644 --- a/terraform/test-fixtures/apply-module-provider-inherit-alias-orphan/main.tf +++ b/terraform/test-fixtures/apply-module-provider-inherit-alias-orphan/main.tf @@ -1,8 +1,6 @@ provider "aws" { - root = 1 } provider "aws" { - child = "eu" - alias = "eu" + alias = "eu" }