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

Commit

Permalink
fixed unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Daniel Rammer <[email protected]>
  • Loading branch information
hamersaw committed May 17, 2022
1 parent f3d9f24 commit 430dac6
Showing 1 changed file with 1 addition and 32 deletions.
33 changes: 1 addition & 32 deletions pkg/controller/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -462,8 +462,7 @@ func TestPropeller_Handle(t *testing.T) {
assert.Equal(t, 0, len(r.Finalizers))
assert.True(t, HasCompletedLabel(r))
})

t.Run("continueOnExecutionNotFoundError", func(t *testing.T) {
t.Run("failOnExecutionNotFoundError", func(t *testing.T) {
assert.NoError(t, s.Create(ctx, &v1alpha1.FlyteWorkflow{
ObjectMeta: v1.ObjectMeta{
Name: name,
Expand All @@ -485,36 +484,6 @@ func TestPropeller_Handle(t *testing.T) {
Message: "The execution that the event belongs to does not exist",
}, "failed to transition phase")
}
assert.Error(t, p.Handle(ctx, namespace, name))

r, err := s.Get(ctx, namespace, name)
assert.NoError(t, err)
assert.Equal(t, v1alpha1.WorkflowPhaseRunning, r.GetExecutionStatus().GetPhase())
assert.Equal(t, 0, len(r.Finalizers))
assert.False(t, HasCompletedLabel(r))
})
t.Run("failOnExecutionNotFoundError", func(t *testing.T) {
assert.NoError(t, s.Create(ctx, &v1alpha1.FlyteWorkflow{
ObjectMeta: v1.ObjectMeta{
Name: name,
Namespace: namespace,
},
WorkflowSpec: &v1alpha1.WorkflowSpec{
ID: "w1",
},
Status: v1alpha1.WorkflowStatus{
Phase: v1alpha1.WorkflowPhaseRunning,
FailedAttempts: 1,
},
}))
exec.HandleAbortedCb = func(ctx context.Context, w *v1alpha1.FlyteWorkflow, maxRetries uint32) error {
return workflowErrors.Wrapf(workflowErrors.EventRecordingError, "",
&eventErrors.EventError{
Code: eventErrors.ExecutionNotFound,
Cause: nil,
Message: "The execution that the event belongs to does not exist",
}, "failed to transition phase")
}
assert.NoError(t, p.Handle(ctx, namespace, name))

r, err := s.Get(ctx, namespace, name)
Expand Down

0 comments on commit 430dac6

Please sign in to comment.