mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-17 15:50:10 +00:00
Add test items for job utils
This commit is contained in:
parent
6fbc554c6b
commit
a0eb194d81
@ -46,4 +46,21 @@ func TestIsJobFinished(t *testing.T) {
|
|||||||
if IsJobFinished(job) {
|
if IsJobFinished(job) {
|
||||||
t.Error("Job was not expected to be finished")
|
t.Error("Job was not expected to be finished")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
job.Status.Conditions[0].Type = batch.JobFailed
|
||||||
|
|
||||||
|
job.Status.Conditions[0].Status = v1.ConditionTrue
|
||||||
|
if !IsJobFinished(job) {
|
||||||
|
t.Error("Job was expected to be finished")
|
||||||
|
}
|
||||||
|
|
||||||
|
job.Status.Conditions[0].Status = v1.ConditionFalse
|
||||||
|
if IsJobFinished(job) {
|
||||||
|
t.Error("Job was not expected to be finished")
|
||||||
|
}
|
||||||
|
|
||||||
|
job.Status.Conditions[0].Status = v1.ConditionUnknown
|
||||||
|
if IsJobFinished(job) {
|
||||||
|
t.Error("Job was not expected to be finished")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user