Skip to content

Commit

Permalink
Merge pull request #1541 from novilabs/fix-test-job-evals
Browse files Browse the repository at this point in the history
it is possible to have more than 1 eval if the eval fails, use the last one
  • Loading branch information
dadgar committed Aug 8, 2016
2 parents a950781 + f523357 commit 044e067
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions api/jobs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -281,9 +281,11 @@ func TestJobs_Evaluations(t *testing.T) {
}
assertQueryMeta(t, qm)

// Check that we got the evals back
if n := len(evals); n == 0 || evals[0].ID != evalID {
t.Fatalf("expected 1 eval (%s), got: %#v", evalID, evals)
// Check that we got the evals back, evals are in order most recent to least recent
// so the last eval is the original registered eval
idx := len(evals) - 1
if n := len(evals); n == 0 || evals[idx].ID != evalID {
t.Fatalf("expected >= 1 eval (%s), got: %#v", evalID, evals[idx])
}
}

Expand Down

0 comments on commit 044e067

Please sign in to comment.