diff --git a/api/jobs_test.go b/api/jobs_test.go index 205a7750a..7f6fa83fc 100644 --- a/api/jobs_test.go +++ b/api/jobs_test.go @@ -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) } }