Skip to content

Commit

Permalink
CCIP-1142 - Add back failing asserts (#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
jarnaud authored Oct 10, 2023
1 parent 99e280f commit 406bb6b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/services/job/job_orm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1474,6 +1474,7 @@ func Test_FindPipelineRunIDsByJobID(t *testing.T) {
runIDs, err := orm.FindPipelineRunIDsByJobID(jobs[3].ID, 95, 10)
require.NoError(t, err)
require.Len(t, runIDs, 10)
assert.Equal(t, int64(4*(len(jobs)-1)), runIDs[3]-runIDs[7])
})

// Internally these queries are batched by 1000, this tests case requiring concatenation
Expand All @@ -1482,6 +1483,7 @@ func Test_FindPipelineRunIDsByJobID(t *testing.T) {
runIDs, err := orm.FindPipelineRunIDsByJobID(jobs[3].ID, 95, 100)
require.NoError(t, err)
require.Len(t, runIDs, 100)
assert.Equal(t, int64(67*(len(jobs)-1)), runIDs[12]-runIDs[79])
})

for i := 0; i < 2100; i++ {
Expand All @@ -1495,13 +1497,15 @@ func Test_FindPipelineRunIDsByJobID(t *testing.T) {
runIDs, err := orm.FindPipelineRunIDsByJobID(jobs[3].ID, 0, 25)
require.NoError(t, err)
require.Len(t, runIDs, 25)
assert.Equal(t, int64(16*(len(jobs)-1)), runIDs[7]-runIDs[23])
})

// Same as previous, but where there are fewer matching jobs than the limit
t.Run("with first batch empty, under limit", func(t *testing.T) {
runIDs, err := orm.FindPipelineRunIDsByJobID(jobs[3].ID, 143, 190)
require.NoError(t, err)
require.Len(t, runIDs, 107)
assert.Equal(t, int64(16*(len(jobs)-1)), runIDs[7]-runIDs[23])
})
}

Expand Down

0 comments on commit 406bb6b

Please sign in to comment.