diff --git a/packages/cli/internal/pkg/aws/cfn/stack_filters.go b/packages/cli/internal/pkg/aws/cfn/stack_filters.go index 9061a244..dd5b9a91 100644 --- a/packages/cli/internal/pkg/aws/cfn/stack_filters.go +++ b/packages/cli/internal/pkg/aws/cfn/stack_filters.go @@ -2,25 +2,42 @@ package cfn import "github.com/aws/aws-sdk-go-v2/service/cloudformation/types" -var ActiveStacksFilter = []types.StackStatus{ - types.StackStatusCreateInProgress, - types.StackStatusCreateComplete, - types.StackStatusRollbackInProgress, - types.StackStatusRollbackFailed, - types.StackStatusRollbackComplete, - types.StackStatusDeleteInProgress, - types.StackStatusDeleteFailed, - types.StackStatusUpdateInProgress, - types.StackStatusUpdateCompleteCleanupInProgress, - types.StackStatusUpdateComplete, - types.StackStatusUpdateRollbackInProgress, - types.StackStatusUpdateRollbackFailed, - types.StackStatusUpdateRollbackCompleteCleanupInProgress, - types.StackStatusUpdateRollbackComplete, - types.StackStatusReviewInProgress, - types.StackStatusImportInProgress, - types.StackStatusImportComplete, - types.StackStatusImportRollbackInProgress, - types.StackStatusImportRollbackFailed, - types.StackStatusImportRollbackComplete, +type StackOptions struct { + activeStack bool + queryableStack bool +} + +var stackDefinitions = map[types.StackStatus]StackOptions{ + types.StackStatusCreateInProgress: {activeStack: true, queryableStack: false}, + types.StackStatusCreateComplete: {activeStack: true, queryableStack: true}, + types.StackStatusRollbackInProgress: {activeStack: true, queryableStack: false}, + types.StackStatusRollbackFailed: {activeStack: true, queryableStack: false}, + types.StackStatusRollbackComplete: {activeStack: true, queryableStack: false}, + types.StackStatusDeleteInProgress: {activeStack: true, queryableStack: false}, + types.StackStatusDeleteFailed: {activeStack: true, queryableStack: false}, + types.StackStatusUpdateInProgress: {activeStack: true, queryableStack: true}, + types.StackStatusUpdateCompleteCleanupInProgress: {activeStack: true, queryableStack: true}, + types.StackStatusUpdateComplete: {activeStack: true, queryableStack: true}, + types.StackStatusUpdateRollbackInProgress: {activeStack: true, queryableStack: true}, + types.StackStatusUpdateRollbackFailed: {activeStack: true, queryableStack: true}, + types.StackStatusUpdateRollbackCompleteCleanupInProgress: {activeStack: true, queryableStack: true}, + types.StackStatusUpdateRollbackComplete: {activeStack: true, queryableStack: false}, + types.StackStatusReviewInProgress: {activeStack: true, queryableStack: true}, + types.StackStatusImportInProgress: {activeStack: true, queryableStack: true}, + types.StackStatusImportComplete: {activeStack: true, queryableStack: true}, + types.StackStatusImportRollbackInProgress: {activeStack: true, queryableStack: true}, + types.StackStatusImportRollbackFailed: {activeStack: true, queryableStack: true}, + types.StackStatusImportRollbackComplete: {activeStack: true, queryableStack: true}, +} +var ActiveStacksFilter []types.StackStatus +var QueryableStacksMap map[types.StackStatus]bool + +func init() { + QueryableStacksMap = make(map[types.StackStatus]bool) + for stackStatus, stackOptions := range stackDefinitions { + QueryableStacksMap[stackStatus] = stackOptions.queryableStack + if stackOptions.activeStack { + ActiveStacksFilter = append(ActiveStacksFilter, stackStatus) + } + } } diff --git a/packages/cli/internal/pkg/cli/workflow/manager.go b/packages/cli/internal/pkg/cli/workflow/manager.go index 2049cc9d..b4ae0bb3 100644 --- a/packages/cli/internal/pkg/cli/workflow/manager.go +++ b/packages/cli/internal/pkg/cli/workflow/manager.go @@ -331,7 +331,7 @@ func (m *Manager) isContextDeployed(contextName string) bool { return false } engineStackName := awsresources.RenderContextStackName(m.projectSpec.Name, contextName, m.userId) - _, err := m.Cfn.GetStackStatus(engineStackName) + status, err := m.Cfn.GetStackStatus(engineStackName) if err != nil { if errors.Is(err, cfn.StackDoesNotExistError) { return false @@ -339,7 +339,9 @@ func (m *Manager) isContextDeployed(contextName string) bool { m.err = err return false } - return true + + ok, activeStatusFlag := cfn.QueryableStacksMap[status] + return ok && activeStatusFlag } func (m *Manager) setContext(contextName string) { diff --git a/packages/cli/internal/pkg/cli/workflow/workflow_status_test.go b/packages/cli/internal/pkg/cli/workflow/workflow_status_test.go index 28d7c3aa..962f38c2 100644 --- a/packages/cli/internal/pkg/cli/workflow/workflow_status_test.go +++ b/packages/cli/internal/pkg/cli/workflow/workflow_status_test.go @@ -29,6 +29,42 @@ const ( testRunStatusUnknown = "UNKNOWN" ) +var workflowInstance1 = ddb.WorkflowInstance{ + RunId: testRun1Id, + WorkflowName: testWorkflow1, + ContextName: testContext1Name, + ProjectName: testProjectName, + UserId: testUserId, + CreatedTime: testWorkflowSubmitTime1, +} + +var workflowInstance2 = ddb.WorkflowInstance{ + RunId: testRun2Id, + WorkflowName: testWorkflow1, + ContextName: testContext1Name, + ProjectName: testProjectName, + UserId: testUserId, + CreatedTime: testWorkflowSubmitTime2, +} + +var instanceSummary1 = InstanceSummary{ + Id: testRun1Id, + WorkflowName: testWorkflow1, + ContextName: testContext1Name, + SubmitTime: testWorkflowSubmitTime1, + InProject: true, + State: testRunStatus1, +} + +var instanceSummary2 = InstanceSummary{ + Id: testRun2Id, + WorkflowName: testWorkflow1, + ContextName: testContext1Name, + SubmitTime: testWorkflowSubmitTime2, + InProject: true, + State: testRunStatus2, +} + type WorkflowStatusTestSuite struct { suite.Suite ctrl *gomock.Controller @@ -115,22 +151,8 @@ func (s *WorkflowStatusTestSuite) TestStatusWorkflowAll_InstancesSameContext() { s.mockProjectClient.EXPECT().Read().Return(s.testProjSpec, nil) s.mockConfigClient.EXPECT().GetUserId().Return(testUserId, nil) instances := []ddb.WorkflowInstance{ - { - RunId: testRun2Id, - WorkflowName: testWorkflow1, - ContextName: testContext1Name, - ProjectName: testProjectName, - UserId: testUserId, - CreatedTime: testWorkflowSubmitTime2, - }, - { - RunId: testRun1Id, - WorkflowName: testWorkflow1, - ContextName: testContext1Name, - ProjectName: testProjectName, - UserId: testUserId, - CreatedTime: testWorkflowSubmitTime1, - }, + workflowInstance2, + workflowInstance1, } s.mockDdb.EXPECT().ListWorkflowInstances(ctx.Background(), testProjectName, testUserId, testWorkflowInstancesLimit).Return(instances, nil) s.mockCfn.EXPECT().GetStackStatus(testContext1Stack).Return(types.StackStatusCreateComplete, nil) @@ -143,22 +165,8 @@ func (s *WorkflowStatusTestSuite) TestStatusWorkflowAll_InstancesSameContext() { actualStatuses, err := s.manager.StatusWorkflowAll(testWorkflowInstancesLimit) if s.Assert().NoError(err) { expectedStatuses := []InstanceSummary{ - { - Id: testRun2Id, - WorkflowName: testWorkflow1, - ContextName: testContext1Name, - SubmitTime: testWorkflowSubmitTime2, - InProject: true, - State: testRunStatus2, - }, - { - Id: testRun1Id, - WorkflowName: testWorkflow1, - ContextName: testContext1Name, - SubmitTime: testWorkflowSubmitTime1, - InProject: true, - State: testRunStatus1, - }, + instanceSummary2, + instanceSummary1, } s.Assert().Equal(expectedStatuses, actualStatuses) } @@ -169,14 +177,7 @@ func (s *WorkflowStatusTestSuite) TestStatusWorkflowAll_InstancesDifferentContex s.mockProjectClient.EXPECT().Read().Return(s.testProjSpec, nil) s.mockConfigClient.EXPECT().GetUserId().Return(testUserId, nil) instances := []ddb.WorkflowInstance{ - { - RunId: testRun1Id, - WorkflowName: testWorkflow1, - ContextName: testContext1Name, - ProjectName: testProjectName, - UserId: testUserId, - CreatedTime: testWorkflowSubmitTime1, - }, + workflowInstance1, { RunId: testRun2Id, WorkflowName: testWorkflow1, @@ -201,14 +202,7 @@ func (s *WorkflowStatusTestSuite) TestStatusWorkflowAll_InstancesDifferentContex actualStatuses, err := s.manager.StatusWorkflowAll(testWorkflowInstancesLimit) if s.Assert().NoError(err) { expectedStatuses := []InstanceSummary{ - { - Id: testRun1Id, - WorkflowName: testWorkflow1, - ContextName: testContext1Name, - SubmitTime: testWorkflowSubmitTime1, - InProject: true, - State: testRunStatus1, - }, + instanceSummary1, { Id: testRun2Id, WorkflowName: testWorkflow1, @@ -227,14 +221,7 @@ func (s *WorkflowStatusTestSuite) TestStatusWorkflowAll_WorkflowNotInProject() { s.mockProjectClient.EXPECT().Read().Return(s.testProjSpec, nil) s.mockConfigClient.EXPECT().GetUserId().Return(testUserId, nil) instances := []ddb.WorkflowInstance{ - { - RunId: testRun1Id, - WorkflowName: testWorkflow1, - ContextName: testContext1Name, - ProjectName: testProjectName, - UserId: testUserId, - CreatedTime: testWorkflowSubmitTime1, - }, + workflowInstance1, { RunId: testRun2Id, WorkflowName: testWorkflow2, @@ -255,14 +242,7 @@ func (s *WorkflowStatusTestSuite) TestStatusWorkflowAll_WorkflowNotInProject() { actualStatuses, err := s.manager.StatusWorkflowAll(testWorkflowInstancesLimit) if s.Assert().NoError(err) { expectedStatuses := []InstanceSummary{ - { - Id: testRun1Id, - WorkflowName: testWorkflow1, - ContextName: testContext1Name, - SubmitTime: testWorkflowSubmitTime1, - InProject: true, - State: testRunStatus1, - }, + instanceSummary1, { Id: testRun2Id, WorkflowName: testWorkflow2, @@ -281,22 +261,8 @@ func (s *WorkflowStatusTestSuite) TestStatusWorkflow_SomeUnknownInstance() { s.mockProjectClient.EXPECT().Read().Return(s.testProjSpec, nil) s.mockConfigClient.EXPECT().GetUserId().Return(testUserId, nil) instances := []ddb.WorkflowInstance{ - { - RunId: testRun1Id, - WorkflowName: testWorkflow1, - ContextName: testContext1Name, - ProjectName: testProjectName, - UserId: testUserId, - CreatedTime: testWorkflowSubmitTime1, - }, - { - RunId: testRun2Id, - WorkflowName: testWorkflow1, - ContextName: testContext1Name, - ProjectName: testProjectName, - UserId: testUserId, - CreatedTime: testWorkflowSubmitTime2, - }, + workflowInstance1, + workflowInstance2, } s.mockDdb.EXPECT().ListWorkflowInstances(ctx.Background(), testProjectName, testUserId, testWorkflowInstancesLimit).Return(instances, nil) s.mockCfn.EXPECT().GetStackStatus(testContext1Stack).Return(types.StackStatusCreateComplete, nil) @@ -309,14 +275,7 @@ func (s *WorkflowStatusTestSuite) TestStatusWorkflow_SomeUnknownInstance() { actualStatuses, err := s.manager.StatusWorkflowAll(testWorkflowInstancesLimit) if s.Assert().NoError(err) { expectedStatuses := []InstanceSummary{ - { - Id: testRun2Id, - WorkflowName: testWorkflow1, - ContextName: testContext1Name, - SubmitTime: testWorkflowSubmitTime2, - InProject: true, - State: testRunStatus2, - }, + instanceSummary2, } s.Assert().Equal(expectedStatuses, actualStatuses) } @@ -327,14 +286,7 @@ func (s *WorkflowStatusTestSuite) TestStatusWorkflow_AllUnknownInstance() { s.mockProjectClient.EXPECT().Read().Return(s.testProjSpec, nil) s.mockConfigClient.EXPECT().GetUserId().Return(testUserId, nil) instances := []ddb.WorkflowInstance{ - { - RunId: testRun1Id, - WorkflowName: testWorkflow1, - ContextName: testContext1Name, - ProjectName: testProjectName, - UserId: testUserId, - CreatedTime: testWorkflowSubmitTime1, - }, + workflowInstance1, } s.mockDdb.EXPECT().ListWorkflowInstances(ctx.Background(), testProjectName, testUserId, testWorkflowInstancesLimit).Return(instances, nil) s.mockCfn.EXPECT().GetStackStatus(testContext1Stack).Return(types.StackStatusCreateComplete, nil) @@ -349,19 +301,44 @@ func (s *WorkflowStatusTestSuite) TestStatusWorkflow_AllUnknownInstance() { } } -func (s *WorkflowStatusTestSuite) TestStatusWorkflow_NonActiveContext() { +func (s *WorkflowStatusTestSuite) TestStatusWorkflow_ErrorStatusContexts() { defer s.ctrl.Finish() s.mockProjectClient.EXPECT().Read().Return(s.testProjSpec, nil) s.mockConfigClient.EXPECT().GetUserId().Return(testUserId, nil) instances := []ddb.WorkflowInstance{ + workflowInstance1, { - RunId: testRun1Id, + RunId: testRun2Id, WorkflowName: testWorkflow1, - ContextName: testContext1Name, + ContextName: testContext2Name, ProjectName: testProjectName, UserId: testUserId, - CreatedTime: testWorkflowSubmitTime1, + CreatedTime: testWorkflowSubmitTime2, }, + } + s.mockDdb.EXPECT().ListWorkflowInstances(ctx.Background(), testProjectName, testUserId, testWorkflowInstancesLimit).Return(instances, nil) + s.mockCfn.EXPECT().GetStackStatus(testContext1Stack).Return(types.StackStatusCreateComplete, nil) + s.mockCfn.EXPECT().GetStackStatus(testContext2Stack).Return(types.StackStatus(""), cfn.StackDoesNotExistError) + s.mockCfn.EXPECT().GetStackInfo(testContext1Stack).Return(cfn.StackInfo{ + Outputs: map[string]string{"WesUrl": testWes1Url}, + }, nil) + s.mockWes1.EXPECT().GetRunStatus(context.Background(), testRun1Id).Return(testRunStatus1, nil) + + actualStatuses, err := s.manager.StatusWorkflowAll(testWorkflowInstancesLimit) + if s.Assert().NoError(err) { + expectedStatuses := []InstanceSummary{ + instanceSummary1, + } + s.Assert().Equal(expectedStatuses, actualStatuses) + } +} + +func (s *WorkflowStatusTestSuite) TestStatusWorkflow_NonActiveContexts() { + defer s.ctrl.Finish() + s.mockProjectClient.EXPECT().Read().Return(s.testProjSpec, nil) + s.mockConfigClient.EXPECT().GetUserId().Return(testUserId, nil) + instances := []ddb.WorkflowInstance{ + workflowInstance1, { RunId: testRun2Id, WorkflowName: testWorkflow1, @@ -373,7 +350,7 @@ func (s *WorkflowStatusTestSuite) TestStatusWorkflow_NonActiveContext() { } s.mockDdb.EXPECT().ListWorkflowInstances(ctx.Background(), testProjectName, testUserId, testWorkflowInstancesLimit).Return(instances, nil) s.mockCfn.EXPECT().GetStackStatus(testContext1Stack).Return(types.StackStatusCreateComplete, nil) - s.mockCfn.EXPECT().GetStackStatus(testContext2Stack).Return(types.StackStatus(""), cfn.StackDoesNotExistError) + s.mockCfn.EXPECT().GetStackStatus(testContext2Stack).Return(types.StackStatusDeleteInProgress, nil) s.mockCfn.EXPECT().GetStackInfo(testContext1Stack).Return(cfn.StackInfo{ Outputs: map[string]string{"WesUrl": testWes1Url}, }, nil) @@ -382,14 +359,7 @@ func (s *WorkflowStatusTestSuite) TestStatusWorkflow_NonActiveContext() { actualStatuses, err := s.manager.StatusWorkflowAll(testWorkflowInstancesLimit) if s.Assert().NoError(err) { expectedStatuses := []InstanceSummary{ - { - Id: testRun1Id, - WorkflowName: testWorkflow1, - ContextName: testContext1Name, - SubmitTime: testWorkflowSubmitTime1, - InProject: true, - State: testRunStatus1, - }, + instanceSummary1, } s.Assert().Equal(expectedStatuses, actualStatuses) } @@ -427,14 +397,7 @@ func (s *WorkflowStatusTestSuite) TestStatusWorkflow_CfnFailed1() { s.mockProjectClient.EXPECT().Read().Return(s.testProjSpec, nil) s.mockConfigClient.EXPECT().GetUserId().Return(testUserId, nil) instances := []ddb.WorkflowInstance{ - { - RunId: testRun1Id, - WorkflowName: testWorkflow1, - ContextName: testContext1Name, - ProjectName: testProjectName, - UserId: testUserId, - CreatedTime: testWorkflowSubmitTime1, - }, + workflowInstance1, } s.mockDdb.EXPECT().ListWorkflowInstances(ctx.Background(), testProjectName, testUserId, testWorkflowInstancesLimit).Return(instances, nil) s.mockCfn.EXPECT().GetStackStatus(testContext1Stack).Return(types.StackStatusCreateComplete, nil) @@ -453,14 +416,7 @@ func (s *WorkflowStatusTestSuite) TestStatusWorkflow_CfnFailed2() { s.mockProjectClient.EXPECT().Read().Return(s.testProjSpec, nil) s.mockConfigClient.EXPECT().GetUserId().Return(testUserId, nil) instances := []ddb.WorkflowInstance{ - { - RunId: testRun1Id, - WorkflowName: testWorkflow1, - ContextName: testContext1Name, - ProjectName: testProjectName, - UserId: testUserId, - CreatedTime: testWorkflowSubmitTime1, - }, + workflowInstance1, } s.mockDdb.EXPECT().ListWorkflowInstances(ctx.Background(), testProjectName, testUserId, testWorkflowInstancesLimit).Return(instances, nil) s.mockCfn.EXPECT().GetStackStatus(testContext1Stack).Return(types.StackStatus(""), errors.New(errorMessage)) @@ -478,14 +434,7 @@ func (s *WorkflowStatusTestSuite) TestStatusWorkflow_WesFailed() { s.mockProjectClient.EXPECT().Read().Return(s.testProjSpec, nil) s.mockConfigClient.EXPECT().GetUserId().Return(testUserId, nil) instances := []ddb.WorkflowInstance{ - { - RunId: testRun1Id, - WorkflowName: testWorkflow1, - ContextName: testContext1Name, - ProjectName: testProjectName, - UserId: testUserId, - CreatedTime: testWorkflowSubmitTime1, - }, + workflowInstance1, } s.mockDdb.EXPECT().ListWorkflowInstances(ctx.Background(), testProjectName, testUserId, testWorkflowInstancesLimit).Return(instances, nil) s.mockCfn.EXPECT().GetStackStatus(testContext1Stack).Return(types.StackStatusCreateComplete, nil) @@ -506,22 +455,8 @@ func (s *WorkflowStatusTestSuite) TestStatusWorkflowByContext_Nominal() { s.mockProjectClient.EXPECT().Read().Return(s.testProjSpec, nil) s.mockConfigClient.EXPECT().GetUserId().Return(testUserId, nil) instances := []ddb.WorkflowInstance{ - { - RunId: testRun2Id, - WorkflowName: testWorkflow1, - ContextName: testContext1Name, - ProjectName: testProjectName, - UserId: testUserId, - CreatedTime: testWorkflowSubmitTime2, - }, - { - RunId: testRun1Id, - WorkflowName: testWorkflow1, - ContextName: testContext1Name, - ProjectName: testProjectName, - UserId: testUserId, - CreatedTime: testWorkflowSubmitTime1, - }, + workflowInstance2, + workflowInstance1, } s.mockDdb.EXPECT().ListWorkflowInstancesByContext(ctx.Background(), testProjectName, testUserId, testContext1Name, testWorkflowInstancesLimit).Return(instances, nil) s.mockCfn.EXPECT().GetStackStatus(testContext1Stack).Return(types.StackStatusCreateComplete, nil) @@ -534,22 +469,8 @@ func (s *WorkflowStatusTestSuite) TestStatusWorkflowByContext_Nominal() { actualStatuses, err := s.manager.StatusWorkflowByContext(testContext1Name, testWorkflowInstancesLimit) if s.Assert().NoError(err) { expectedStatuses := []InstanceSummary{ - { - Id: testRun2Id, - WorkflowName: testWorkflow1, - ContextName: testContext1Name, - SubmitTime: testWorkflowSubmitTime2, - InProject: true, - State: testRunStatus2, - }, - { - Id: testRun1Id, - WorkflowName: testWorkflow1, - ContextName: testContext1Name, - SubmitTime: testWorkflowSubmitTime1, - InProject: true, - State: testRunStatus1, - }, + instanceSummary2, + instanceSummary1, } s.Assert().Equal(expectedStatuses, actualStatuses) } @@ -560,22 +481,8 @@ func (s *WorkflowStatusTestSuite) TestStatusWorkflowByName_Nominal() { s.mockProjectClient.EXPECT().Read().Return(s.testProjSpec, nil) s.mockConfigClient.EXPECT().GetUserId().Return(testUserId, nil) instances := []ddb.WorkflowInstance{ - { - RunId: testRun2Id, - WorkflowName: testWorkflow1, - ContextName: testContext1Name, - ProjectName: testProjectName, - UserId: testUserId, - CreatedTime: testWorkflowSubmitTime2, - }, - { - RunId: testRun1Id, - WorkflowName: testWorkflow1, - ContextName: testContext1Name, - ProjectName: testProjectName, - UserId: testUserId, - CreatedTime: testWorkflowSubmitTime1, - }, + workflowInstance2, + workflowInstance1, } s.mockDdb.EXPECT().ListWorkflowInstancesByName(ctx.Background(), testProjectName, testUserId, testWorkflow1, testWorkflowInstancesLimit).Return(instances, nil) s.mockCfn.EXPECT().GetStackStatus(testContext1Stack).Return(types.StackStatusCreateComplete, nil) @@ -588,22 +495,8 @@ func (s *WorkflowStatusTestSuite) TestStatusWorkflowByName_Nominal() { actualStatuses, err := s.manager.StatusWorkflowByName(testWorkflow1, testWorkflowInstancesLimit) if s.Assert().NoError(err) { expectedStatuses := []InstanceSummary{ - { - Id: testRun2Id, - WorkflowName: testWorkflow1, - ContextName: testContext1Name, - SubmitTime: testWorkflowSubmitTime2, - InProject: true, - State: testRunStatus2, - }, - { - Id: testRun1Id, - WorkflowName: testWorkflow1, - ContextName: testContext1Name, - SubmitTime: testWorkflowSubmitTime1, - InProject: true, - State: testRunStatus1, - }, + instanceSummary2, + instanceSummary1, } s.Assert().Equal(expectedStatuses, actualStatuses) } @@ -613,15 +506,7 @@ func (s *WorkflowStatusTestSuite) TestStatusWorkflowByInstanceId_Nominal() { defer s.ctrl.Finish() s.mockProjectClient.EXPECT().Read().Return(s.testProjSpec, nil) s.mockConfigClient.EXPECT().GetUserId().Return(testUserId, nil) - instance := ddb.WorkflowInstance{ - RunId: testRun1Id, - WorkflowName: testWorkflow1, - ContextName: testContext1Name, - ProjectName: testProjectName, - UserId: testUserId, - CreatedTime: testWorkflowSubmitTime1, - } - s.mockDdb.EXPECT().GetWorkflowInstanceById(ctx.Background(), testProjectName, testUserId, testRun1Id).Return(instance, nil) + s.mockDdb.EXPECT().GetWorkflowInstanceById(ctx.Background(), testProjectName, testUserId, testRun1Id).Return(workflowInstance1, nil) s.mockCfn.EXPECT().GetStackStatus(testContext1Stack).Return(types.StackStatusCreateComplete, nil) s.mockCfn.EXPECT().GetStackInfo(testContext1Stack).Return(cfn.StackInfo{ Outputs: map[string]string{"WesUrl": testWes1Url}, @@ -631,14 +516,7 @@ func (s *WorkflowStatusTestSuite) TestStatusWorkflowByInstanceId_Nominal() { actualStatuses, err := s.manager.StatusWorkflowByInstanceId(testRun1Id) if s.Assert().NoError(err) { expectedStatuses := []InstanceSummary{ - { - Id: testRun1Id, - WorkflowName: testWorkflow1, - ContextName: testContext1Name, - SubmitTime: testWorkflowSubmitTime1, - InProject: true, - State: testRunStatus1, - }, + instanceSummary1, } s.Assert().Equal(expectedStatuses, actualStatuses) }