From 185d9cf7fe53cd72dfc83ae810ef08c98e999c3e Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Mon, 24 Sep 2018 14:39:41 -0700 Subject: [PATCH] core: Fix TestContext2Apply_destroyCrossProviders This test needed a schema that better reflects the expectations of its configuration fixture. --- terraform/context_apply_test.go | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/terraform/context_apply_test.go b/terraform/context_apply_test.go index d76790b11..080c2341a 100644 --- a/terraform/context_apply_test.go +++ b/terraform/context_apply_test.go @@ -1688,6 +1688,26 @@ func TestContext2Apply_destroyCrossProviders(t *testing.T) { p_aws := testProvider("aws") p_aws.ApplyFn = testApplyFn p_aws.DiffFn = testDiffFn + p_aws.GetSchemaReturn = &ProviderSchema{ + ResourceTypes: map[string]*configschema.Block{ + "aws_instance": { + Attributes: map[string]*configschema.Attribute{ + "id": { + Type: cty.String, + Computed: true, + }, + }, + }, + "aws_vpc": { + Attributes: map[string]*configschema.Attribute{ + "value": { + Type: cty.String, + Optional: true, + }, + }, + }, + }, + } providers := map[string]providers.Factory{ "aws": testProviderFuncFixed(p_aws), @@ -1702,11 +1722,13 @@ func TestContext2Apply_destroyCrossProviders(t *testing.T) { ctx := getContextForApply_destroyCrossProviders(t, m, providers) if _, diags := ctx.Plan(); diags.HasErrors() { - t.Fatalf("diags: %s", diags.Err()) + logDiagnostics(t, diags) + t.Fatal("plan failed") } if _, diags := ctx.Apply(); diags.HasErrors() { - t.Fatalf("diags: %s", diags.Err()) + logDiagnostics(t, diags) + t.Fatal("apply failed") } } }