Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
fixed tests
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Su <pingsutw@apache.org>
  • Loading branch information
pingsutw committed Sep 15, 2023
1 parent a417872 commit e040a02
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion go/tasks/plugins/hive/execution_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ func Finalize(ctx context.Context, tCtx core.TaskExecutionContext, _ ExecutionSt
}

func InTerminalState(e ExecutionState) bool {
return e.Phase == PhaseQuerySucceeded || e.Phase == PhaseQueryFailed
return e.Phase.IsTerminal()
}

func IsNotYetSubmitted(e ExecutionState) bool {
Expand Down
6 changes: 5 additions & 1 deletion go/tasks/plugins/hive/execution_state_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func TestInTerminalState(t *testing.T) {
e := ExecutionState{Phase: tt.phase}
res := InTerminalState(e)
assert.Equal(t, tt.isTerminal, res)
assert.Equal(t, tt.phase.IsTerminal(), res)
})
}
}
Expand Down Expand Up @@ -338,7 +339,10 @@ func TestKickOffQuery(t *testing.T) {

var getOrCreateCalled = false
mockCache := &mocks2.AutoRefresh{}
mockCache.OnGetOrCreate(mock.Anything, mock.Anything).Run(func(_ mock.Arguments) {
mockCache.OnGetOrCreate(mock.Anything,
ExecutionStateCacheItem{
ExecutionState: ExecutionState{Phase: PhaseSubmitted, CommandID: "453298043"},
Identifier: "my_wf_exec_project:my_wf_exec_domain:my_wf_exec_name"}).Run(func(_ mock.Arguments) {
getOrCreateCalled = true
}).Return(ExecutionStateCacheItem{}, nil)

Expand Down

0 comments on commit e040a02

Please sign in to comment.