Skip to content

Commit

Permalink
use reflect.DeepEqual to compare run structs (kubeflow#3546)
Browse files Browse the repository at this point in the history
  • Loading branch information
chensun authored and Jeffwan committed Dec 9, 2020
1 parent fa159d8 commit 645e269
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions backend/test/integration/run_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package integration

import (
"io/ioutil"
"reflect"
"testing"
"time"

Expand Down Expand Up @@ -263,7 +264,7 @@ func (s *RunApiTestSuite) checkTerminatedRunDetail(t *testing.T, runDetail *run_
ScheduledAt: runDetail.Run.ScheduledAt,
FinishedAt: runDetail.Run.FinishedAt,
}
assert.Equal(t, expectedRun, runDetail.Run)
assert.True(t, reflect.DeepEqual(expectedRun, runDetail.Run))
}

func (s *RunApiTestSuite) checkHelloWorldRunDetail(t *testing.T, runDetail *run_model.APIRunDetail, experimentId string, experimentName string, pipelineVersionId string, pipelineVersionName string) {
Expand Down Expand Up @@ -292,7 +293,7 @@ func (s *RunApiTestSuite) checkHelloWorldRunDetail(t *testing.T, runDetail *run_
ScheduledAt: runDetail.Run.ScheduledAt,
FinishedAt: runDetail.Run.FinishedAt,
}
assert.Equal(t, expectedRun, runDetail.Run)
assert.True(t, reflect.DeepEqual(expectedRun, runDetail.Run))
}

func (s *RunApiTestSuite) checkArgParamsRunDetail(t *testing.T, runDetail *run_model.APIRunDetail, experimentId string, experimentName string) {
Expand Down Expand Up @@ -323,7 +324,7 @@ func (s *RunApiTestSuite) checkArgParamsRunDetail(t *testing.T, runDetail *run_m
ScheduledAt: runDetail.Run.ScheduledAt,
FinishedAt: runDetail.Run.FinishedAt,
}
assert.Equal(t, expectedRun, runDetail.Run)
assert.True(t, reflect.DeepEqual(expectedRun, runDetail.Run))
}

func TestRunApi(t *testing.T) {
Expand Down

0 comments on commit 645e269

Please sign in to comment.