Skip to content

Commit

Permalink
Merge pull request #1578 from novilabs/fix-test-eval-list
Browse files Browse the repository at this point in the history
allow multiple evals check last one in test
  • Loading branch information
dadgar authored Aug 13, 2016
2 parents d937dc7 + f982034 commit fa73b6a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions api/evaluations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,11 @@ func TestEvaluations_List(t *testing.T) {
}
assertQueryMeta(t, qm)

// Check if we have the right list
if len(result) != 1 || result[0].ID != evalID {
t.Fatalf("bad: %#v", result)
// if the eval fails fast there can be more than 1
// but they are in order of most recent first, so look at the last one
idx := len(result) - 1
if len(result) == 0 || result[idx].ID != evalID {
t.Fatalf("expected eval (%s), got: %#v", evalID, result[idx])
}
}

Expand Down

0 comments on commit fa73b6a

Please sign in to comment.