Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
Signed-off-by: Zhang Xin <zhangxin@outlook.com>
  • Loading branch information
rim99 committed Dec 21, 2024
1 parent 50ed388 commit 3c56050
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions cmd/query/app/http_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,16 +200,14 @@ func TestGetTraceDedupeSuccess(t *testing.T) {

func TestGetTraceWithTimeWindowSuccess(t *testing.T) {
ts := initializeTestServer(t)
start_time := time.Date(1970, time.January, 1, 0, 0, 0, 1000, time.UTC).Local()
end_time := time.Date(1970, time.January, 1, 0, 0, 0, 2000, time.UTC).Local()
ts.spanReader.On("GetTrace", mock.AnythingOfType("*context.valueCtx"), spanstore.GetTraceParameters{
TraceID: model.TraceID{High: 0, Low: 0x123456},
StartTime: start_time,
EndTime: end_time,
TraceID: mockTraceID,
StartTime: time.UnixMicro(1),
EndTime: time.UnixMicro(2),
}).Return(mockTrace, nil).Once()

var response structuredResponse
err := getJSON(ts.server.URL+`/api/traces/123456?start=1&end=2`, &response)
err := getJSON(ts.server.URL+`/api/traces/`+mockTraceID.String()+`?start=1&end=2`, &response)
require.NoError(t, err)
assert.Empty(t, response.Errors)
}
Expand Down

0 comments on commit 3c56050

Please sign in to comment.