Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
gt2345 committed Oct 1, 2024
1 parent 0b1ce15 commit df11fb3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
4 changes: 2 additions & 2 deletions master/internal/api_tasks_intg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@ func TestPostTaskLogs(t *testing.T) {
stream = &mockStream[*apiv1.TaskLogsResponse]{ctx: ctx}
err = api.TaskLogs(&apiv1.TaskLogsRequest{
TaskId: string(task.TaskID),
SearchText: "^lo.*xt",
SearchText: "^lo.{4}xt",
}, stream)
require.NoError(t, err)
require.Empty(t, stream.getData())

err = api.TaskLogs(&apiv1.TaskLogsRequest{
TaskId: string(task.TaskID),
SearchText: "^lo.*xt",
SearchText: "^lo.{4}xt",
EnableRegex: true,
}, stream)
require.NoError(t, err)
Expand Down
8 changes: 8 additions & 0 deletions master/internal/db/postgres_tasks_intg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,14 @@ func TestTaskLogsFlow(t *testing.T) {
require.Len(t, logs, 2)

// Filter by search text.
logs, _, err = db.TaskLogs(t1In.TaskID, 5, []api.Filter{{
Field: "log",
Operation: api.FilterOperationStringContainment,
Values: []string{"this"},
}}, apiv1.OrderBy_ORDER_BY_UNSPECIFIED, nil)
require.NoError(t, err)
require.Len(t, logs, 2)

logs, _, err = db.TaskLogs(t1In.TaskID, 5, []api.Filter{{
Field: "log",
Operation: api.FilterOperationStringContainment,
Expand Down

0 comments on commit df11fb3

Please sign in to comment.