Skip to content

Commit

Permalink
integration tests update
Browse files Browse the repository at this point in the history
  • Loading branch information
mszadkow committed Jul 19, 2024
1 parent a074860 commit 116865c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
22 changes: 21 additions & 1 deletion test/integration/controller/jobs/mxjob/mxjob_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,26 @@ var _ = ginkgo.Describe("Job controller when waitForPodsReady enabled", ginkgo.O

ginkgo.DescribeTable("Single job at different stages of progress towards completion",
func(podsReadyTestSpec kftesting.PodsReadyTestSpec) {
kfJob := kubeflowjob.KubeflowJob{KFJobControl: (*workloadmxjob.JobControl)(testingmxjob.MakeMXJob(jobName, ns.Name).Parallelism(2, 2).Obj())}
kfJob := kubeflowjob.KubeflowJob{
KFJobControl: (*workloadmxjob.JobControl)(
testingmxjob.MakeMXJob(jobName, ns.Name).
MXReplicaSpecs(
testingmxjob.MXReplicaSpecRequirement{
ReplicaType: kftraining.MXJobReplicaTypeScheduler,
ReplicaCount: 1,
},
testingmxjob.MXReplicaSpecRequirement{
ReplicaType: kftraining.MXJobReplicaTypeServer,
ReplicaCount: 1,
},
testingmxjob.MXReplicaSpecRequirement{
ReplicaType: kftraining.MXJobReplicaTypeWorker,
ReplicaCount: 1,
},
).
Parallelism(2, 2).
Obj()),
}
createdJob := kubeflowjob.KubeflowJob{KFJobControl: (*workloadmxjob.JobControl)(&kftraining.MXJob{})}

kftesting.JobControllerWhenWaitForPodsReadyEnabled(ctx, k8sClient, kfJob, createdJob, podsReadyTestSpec, []kftesting.PodSetsResource{
Expand Down Expand Up @@ -287,6 +306,7 @@ var _ = ginkgo.Describe("Job controller interacting with scheduler", ginkgo.Orde

kfJob := kubeflowjob.KubeflowJob{KFJobControl: (*workloadmxjob.JobControl)(
testingmxjob.MakeMXJob(jobName, ns.Name).Queue(localQueue.Name).
MXReplicaSpecsDefault().
Request(kftraining.MXJobReplicaTypeScheduler, corev1.ResourceCPU, "3").
Request(kftraining.MXJobReplicaTypeServer, corev1.ResourceCPU, "4").
Request(kftraining.MXJobReplicaTypeWorker, corev1.ResourceCPU, "4").
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ var _ = ginkgo.Describe("Job controller", ginkgo.Ordered, ginkgo.ContinueOnFailu
})

ginkgo.It("Should reconcile PaddleJobs", func() {
kfJob := kubeflowjob.KubeflowJob{KFJobControl: (*workloadpaddlejob.JobControl)(testingpaddlejob.MakePaddleJob(jobName, ns.Name).Obj())}
kfJob := kubeflowjob.KubeflowJob{KFJobControl: (*workloadpaddlejob.JobControl)(testingpaddlejob.MakePaddleJob(jobName, ns.Name).PaddleReplicaSpecsDefault().Obj())}
createdJob := kubeflowjob.KubeflowJob{KFJobControl: (*workloadpaddlejob.JobControl)(&kftraining.PaddleJob{})}

kftesting.ShouldReconcileJob(ctx, k8sClient, kfJob, createdJob, []kftesting.PodSetsResource{
Expand Down Expand Up @@ -127,7 +127,7 @@ var _ = ginkgo.Describe("Job controller when waitForPodsReady enabled", ginkgo.O

ginkgo.DescribeTable("Single job at different stages of progress towards completion",
func(podsReadyTestSpec kftesting.PodsReadyTestSpec) {
kfJob := kubeflowjob.KubeflowJob{KFJobControl: (*workloadpaddlejob.JobControl)(testingpaddlejob.MakePaddleJob(jobName, ns.Name).Parallelism(2).Obj())}
kfJob := kubeflowjob.KubeflowJob{KFJobControl: (*workloadpaddlejob.JobControl)(testingpaddlejob.MakePaddleJob(jobName, ns.Name).PaddleReplicaSpecsDefault().Parallelism(2).Obj())}
createdJob := kubeflowjob.KubeflowJob{KFJobControl: (*workloadpaddlejob.JobControl)(&kftraining.PaddleJob{})}

kftesting.JobControllerWhenWaitForPodsReadyEnabled(ctx, k8sClient, kfJob, createdJob, podsReadyTestSpec, []kftesting.PodSetsResource{
Expand Down Expand Up @@ -281,6 +281,7 @@ var _ = ginkgo.Describe("Job controller interacting with scheduler", ginkgo.Orde

kfJob := kubeflowjob.KubeflowJob{KFJobControl: (*workloadpaddlejob.JobControl)(
testingpaddlejob.MakePaddleJob(jobName, ns.Name).Queue(localQueue.Name).
PaddleReplicaSpecsDefault().
Request(kftraining.PaddleJobReplicaTypeMaster, corev1.ResourceCPU, "3").
Request(kftraining.PaddleJobReplicaTypeWorker, corev1.ResourceCPU, "4").
Obj(),
Expand Down

0 comments on commit 116865c

Please sign in to comment.