Skip to content

Commit

Permalink
Make pluginmachinery/flytek8s tests pass
Browse files Browse the repository at this point in the history
Signed-off-by: Fabio Graetz <[email protected]>
  • Loading branch information
fg91 committed Apr 7, 2024
1 parent c6d0802 commit 3fd60ed
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions flyteplugins/go/tasks/pluginmachinery/flytek8s/pod_helper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1209,7 +1209,7 @@ func TestDemystifyPending(t *testing.T) {
},
},
}
taskStatus, err := DemystifyPending(s)
taskStatus, err := DemystifyPending(s, pluginsCore.TaskInfo{})
assert.NoError(t, err)
assert.Equal(t, pluginsCore.PhaseQueued, taskStatus.Phase())
})
Expand All @@ -1224,7 +1224,7 @@ func TestDemystifyPending(t *testing.T) {
},
},
}
taskStatus, err := DemystifyPending(s)
taskStatus, err := DemystifyPending(s, pluginsCore.TaskInfo{})
assert.NoError(t, err)
assert.Equal(t, pluginsCore.PhaseQueued, taskStatus.Phase())
})
Expand All @@ -1239,7 +1239,7 @@ func TestDemystifyPending(t *testing.T) {
},
},
}
taskStatus, err := DemystifyPending(s)
taskStatus, err := DemystifyPending(s, pluginsCore.TaskInfo{})
assert.NoError(t, err)
assert.Equal(t, pluginsCore.PhaseQueued, taskStatus.Phase())
})
Expand All @@ -1254,7 +1254,7 @@ func TestDemystifyPending(t *testing.T) {
},
},
}
taskStatus, err := DemystifyPending(s)
taskStatus, err := DemystifyPending(s, pluginsCore.TaskInfo{})
assert.NoError(t, err)
assert.Equal(t, pluginsCore.PhaseQueued, taskStatus.Phase())
})
Expand Down Expand Up @@ -1289,7 +1289,7 @@ func TestDemystifyPending(t *testing.T) {
},
},
}
taskStatus, err := DemystifyPending(s)
taskStatus, err := DemystifyPending(s, pluginsCore.TaskInfo{})
assert.NoError(t, err)
assert.Equal(t, pluginsCore.PhaseInitializing, taskStatus.Phase())
})
Expand All @@ -1306,7 +1306,7 @@ func TestDemystifyPending(t *testing.T) {
},
},
}
taskStatus, err := DemystifyPending(s)
taskStatus, err := DemystifyPending(s, pluginsCore.TaskInfo{})
assert.NoError(t, err)
assert.Equal(t, pluginsCore.PhaseInitializing, taskStatus.Phase())
})
Expand All @@ -1323,7 +1323,7 @@ func TestDemystifyPending(t *testing.T) {
},
},
}
taskStatus, err := DemystifyPending(s)
taskStatus, err := DemystifyPending(s, pluginsCore.TaskInfo{})
assert.NoError(t, err)
assert.Equal(t, pluginsCore.PhaseInitializing, taskStatus.Phase())
})
Expand All @@ -1342,7 +1342,7 @@ func TestDemystifyPending(t *testing.T) {
},
},
}
taskStatus, err := DemystifyPending(s2)
taskStatus, err := DemystifyPending(s2, pluginsCore.TaskInfo{})
assert.NoError(t, err)
assert.Equal(t, pluginsCore.PhaseInitializing, taskStatus.Phase())
})
Expand All @@ -1361,7 +1361,7 @@ func TestDemystifyPending(t *testing.T) {
},
},
}
taskStatus, err := DemystifyPending(s2)
taskStatus, err := DemystifyPending(s2, pluginsCore.TaskInfo{})
assert.NoError(t, err)
assert.Equal(t, pluginsCore.PhaseRetryableFailure, taskStatus.Phase())
assert.True(t, taskStatus.CleanupOnFailure())
Expand All @@ -1379,7 +1379,7 @@ func TestDemystifyPending(t *testing.T) {
},
},
}
taskStatus, err := DemystifyPending(s)
taskStatus, err := DemystifyPending(s, pluginsCore.TaskInfo{})
assert.NoError(t, err)
assert.Equal(t, pluginsCore.PhasePermanentFailure, taskStatus.Phase())
assert.True(t, taskStatus.CleanupOnFailure())
Expand All @@ -1397,7 +1397,7 @@ func TestDemystifyPending(t *testing.T) {
},
},
}
taskStatus, err := DemystifyPending(s)
taskStatus, err := DemystifyPending(s, pluginsCore.TaskInfo{})
assert.NoError(t, err)
assert.Equal(t, pluginsCore.PhaseRetryableFailure, taskStatus.Phase())
assert.True(t, taskStatus.CleanupOnFailure())
Expand All @@ -1415,7 +1415,7 @@ func TestDemystifyPending(t *testing.T) {
},
},
}
taskStatus, err := DemystifyPending(s)
taskStatus, err := DemystifyPending(s, pluginsCore.TaskInfo{})
assert.NoError(t, err)
assert.Equal(t, pluginsCore.PhaseRetryableFailure, taskStatus.Phase())
assert.True(t, taskStatus.CleanupOnFailure())
Expand All @@ -1435,7 +1435,7 @@ func TestDemystifyPending(t *testing.T) {
},
},
}
taskStatus, err := DemystifyPending(s2)
taskStatus, err := DemystifyPending(s2, pluginsCore.TaskInfo{})
assert.NoError(t, err)
assert.Equal(t, pluginsCore.PhaseInitializing, taskStatus.Phase())
})
Expand All @@ -1454,7 +1454,7 @@ func TestDemystifyPending(t *testing.T) {
},
},
}
taskStatus, err := DemystifyPending(s2)
taskStatus, err := DemystifyPending(s2, pluginsCore.TaskInfo{})
assert.NoError(t, err)
assert.Equal(t, pluginsCore.PhasePermanentFailure, taskStatus.Phase())
assert.True(t, taskStatus.CleanupOnFailure())
Expand All @@ -1474,7 +1474,7 @@ func TestDemystifyPending(t *testing.T) {
},
},
}
taskStatus, err := DemystifyPending(s2)
taskStatus, err := DemystifyPending(s2, pluginsCore.TaskInfo{})
assert.NoError(t, err)
assert.Equal(t, pluginsCore.PhaseInitializing, taskStatus.Phase())
})
Expand All @@ -1493,7 +1493,7 @@ func TestDemystifyPending(t *testing.T) {
},
},
}
taskStatus, err := DemystifyPending(s2)
taskStatus, err := DemystifyPending(s2, pluginsCore.TaskInfo{})
assert.NoError(t, err)
assert.Equal(t, pluginsCore.PhasePermanentFailure, taskStatus.Phase())
assert.True(t, taskStatus.CleanupOnFailure())
Expand Down Expand Up @@ -1525,7 +1525,7 @@ func TestDemystifyPendingTimeout(t *testing.T) {
s.Conditions[0].LastTransitionTime.Time = metav1.Now().Add(-config.GetK8sPluginConfig().PodPendingTimeout.Duration)

t.Run("PodPendingExceedsTimeout", func(t *testing.T) {
taskStatus, err := DemystifyPending(s)
taskStatus, err := DemystifyPending(s, pluginsCore.TaskInfo{})
assert.NoError(t, err)
assert.Equal(t, pluginsCore.PhaseRetryableFailure, taskStatus.Phase())
assert.Equal(t, "PodPendingTimeout", taskStatus.Err().Code)
Expand Down Expand Up @@ -1672,7 +1672,7 @@ func TestDemystifyPending_testcases(t *testing.T) {
assert.NoError(t, err, "failed to read file %s", testFile)
pod := &v1.Pod{}
if assert.NoError(t, json.Unmarshal(data, pod), "failed to unmarshal json in %s. Expected of type v1.Pod", testFile) {
p, err := DemystifyPending(pod.Status)
p, err := DemystifyPending(pod.Status, pluginsCore.TaskInfo{})
if tt.isErr {
assert.Error(t, err, "Error expected from method")
} else {
Expand Down

0 comments on commit 3fd60ed

Please sign in to comment.