Merge pull request #1542 from novilabs/fix-test-job-summary
just checked the known values in job summary instead of doing a deep equals
This commit is contained in:
commit
56c78f84a4
|
@ -504,6 +504,7 @@ func TestJobs_JobSummary(t *testing.T) {
|
|||
|
||||
// Register the job
|
||||
job := testJob()
|
||||
taskName := job.TaskGroups[0].Name
|
||||
_, wm, err := jobs.Register(job, nil)
|
||||
if err != nil {
|
||||
t.Fatalf("err: %s", err)
|
||||
|
@ -517,18 +518,12 @@ func TestJobs_JobSummary(t *testing.T) {
|
|||
}
|
||||
assertQueryMeta(t, qm)
|
||||
|
||||
expectedJobSummary := JobSummary{
|
||||
JobID: job.ID,
|
||||
Summary: map[string]TaskGroupSummary{
|
||||
job.TaskGroups[0].Name: {},
|
||||
},
|
||||
CreateIndex: result.CreateIndex,
|
||||
ModifyIndex: result.ModifyIndex,
|
||||
}
|
||||
|
||||
// Check that the result is what we expect
|
||||
if !reflect.DeepEqual(&expectedJobSummary, result) {
|
||||
t.Fatalf("expect: %#v, got: %#v", expectedJobSummary, result)
|
||||
if job.ID != result.JobID {
|
||||
t.Fatalf("err: expected job id of %s saw %s", job.ID, result.JobID)
|
||||
}
|
||||
if _, ok := result.Summary[taskName]; !ok {
|
||||
t.Fatalf("err: unable to find %s key in job summary", taskName)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue