Skip to content

Commit

Permalink
fix unit test + linting
Browse files Browse the repository at this point in the history
Signed-off-by: punker <[email protected]>
  • Loading branch information
punkerpunker committed Jan 30, 2025
1 parent 633aa57 commit 644ce84
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,7 @@ func TestReplicaCounts(t *testing.T) {
contains []commonOp.ReplicaType
notContains []commonOp.ReplicaType
}{
{"NoWorkers", 0, true, nil, nil},
{"NoWorkers", 0, false, []commonOp.ReplicaType{kubeflowv1.PyTorchJobReplicaTypeMaster}, []commonOp.ReplicaType{}},
{"Works", 1, false, []commonOp.ReplicaType{kubeflowv1.PyTorchJobReplicaTypeMaster, kubeflowv1.PyTorchJobReplicaTypeWorker}, []commonOp.ReplicaType{}},
} {
t.Run(test.name, func(t *testing.T) {
Expand Down Expand Up @@ -1266,7 +1266,7 @@ func TestBuildResourcePytorchV1WithDifferentWorkersNumber(t *testing.T) {
pytorchJob, ok := res.(*kubeflowv1.PyTorchJob)
assert.True(t, ok)

if taskConfig.WorkerReplicas.Replicas == 0 {
if taskConfig.GetWorkerReplicas().GetReplicas() == 0 {
// Should only contain master spec
assert.Equal(t, 1, len(pytorchJob.Spec.PyTorchReplicaSpecs))
assert.Contains(t, pytorchJob.Spec.PyTorchReplicaSpecs, kubeflowv1.PyTorchJobReplicaTypeMaster)
Expand Down

0 comments on commit 644ce84

Please sign in to comment.