Skip to content

Commit

Permalink
Fix validation tests and account for invalid cleanPodPolicy (#387)
Browse files Browse the repository at this point in the history
  • Loading branch information
alculquicondor authored Jul 28, 2021
1 parent 9ce6467 commit 108a697
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions v2/pkg/apis/kubeflow/validation/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,15 @@ func TestValidateMPIJob(t *testing.T) {
},
},
},
"invalid name": {
"invalid fields": {
job: v2beta1.MPIJob{
ObjectMeta: metav1.ObjectMeta{
Name: "this-name-is-waaaaaaaay-too-long-for-a-worker-hostname",
},
Spec: v2beta1.MPIJobSpec{
SlotsPerWorker: newInt32(2),
CleanPodPolicy: newCleanPodPolicy(common.CleanPodPolicyRunning),
SlotsPerWorker: newInt32(2),
CleanPodPolicy: newCleanPodPolicy("unknown"),
SSHAuthMountPath: "/root/.ssh",
MPIReplicaSpecs: map[v2beta1.MPIReplicaType]*common.ReplicaSpec{
v2beta1.MPIReplicaTypeLauncher: {
Replicas: newInt32(1),
Expand All @@ -140,6 +141,10 @@ func TestValidateMPIJob(t *testing.T) {
Type: field.ErrorTypeInvalid,
Field: "metadata.name",
},
{
Type: field.ErrorTypeNotSupported,
Field: "spec.cleanPodPolicy",
},
},
},
"empty replica specs": {
Expand Down

0 comments on commit 108a697

Please sign in to comment.