From 1d6fe4286002b3d49619c1b85489487cdbf54f48 Mon Sep 17 00:00:00 2001 From: Aidan Steele Date: Sun, 5 May 2019 13:17:07 +1000 Subject: [PATCH] fix tests --- go.mod | 1 + pkg/stackit/up_test.go | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/go.mod b/go.mod index d23aeaa..5d38e12 100644 --- a/go.mod +++ b/go.mod @@ -15,6 +15,7 @@ require ( github.com/spf13/cobra v0.0.3 github.com/spf13/pflag v1.0.3 // indirect github.com/spf13/viper v1.2.1 + github.com/stretchr/testify v1.2.2 golang.org/x/net v0.0.0-20181114220301-adae6a3d119a // indirect golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b // indirect gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect diff --git a/pkg/stackit/up_test.go b/pkg/stackit/up_test.go index 80b7e9d..e714962 100644 --- a/pkg/stackit/up_test.go +++ b/pkg/stackit/up_test.go @@ -65,6 +65,16 @@ func TestServiceRoleArnDoesntTriggerStsCall(t *testing.T) { return nil, errors.New("done") } + capi.DescribeStacksF = func(input *cloudformation.DescribeStacksInput) (*cloudformation.DescribeStacksOutput, error) { + return &cloudformation.DescribeStacksOutput{ + Stacks: []*cloudformation.Stack{ + { + StackId: aws.String("arn:aws:cloudformation:ap-southeast-2:657110686698:stack/stack-name/58ed6a10-3e2f-11e9-bc5f-0a9966e9c45e"), + }, + }, + }, nil + } + ch := make(chan TailStackEvent) go s.Up(input, ch)