Skip to content

Commit a215c60

Browse files
committed
Add e2e tests
Signed-off-by: Michal Szadkowski <[email protected]>
1 parent cd19b22 commit a215c60

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

test/e2e/mpi_job_test.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,30 @@ var _ = ginkgo.Describe("MPIJob", func() {
164164
mpiJob := createJobAndWaitForCompletion(mpiJob)
165165
expectConditionToBeTrue(mpiJob, kubeflow.JobSucceeded)
166166
})
167+
168+
ginkgo.It("should not complete when managed externaly", func() {
169+
mpiJob.Spec.RunPolicy.ManagedBy = ptr.To(kubeflow.MultiKueueController)
170+
ctx := context.Background()
171+
mpiJob = createJob(ctx, mpiJob)
172+
173+
err := wait.PollUntilContextTimeout(ctx, waitInterval, foreverTimeout, false, func(ctx context.Context) (bool, error) {
174+
updatedJob, err := mpiClient.KubeflowV2beta1().MPIJobs(mpiJob.Namespace).Get(ctx, mpiJob.Name, metav1.GetOptions{})
175+
if err != nil {
176+
return false, err
177+
}
178+
mpiJob = updatedJob
179+
return mpiJob.Status.CompletionTime != nil, nil
180+
})
181+
gomega.Expect(err).To(gomega.BeNil())
182+
183+
// job should be created, but never succeeded
184+
condition := getJobCondition(mpiJob, kubeflow.JobCreated)
185+
gomega.Expect(condition).ToNot(gomega.BeNil())
186+
gomega.Expect(condition.Status).To(gomega.Equal(corev1.ConditionTrue))
187+
188+
condition = getJobCondition(mpiJob, kubeflow.JobSucceeded)
189+
gomega.Expect(condition).To(gomega.BeNil())
190+
})
167191
})
168192

169193
})

0 commit comments

Comments
 (0)