Skip to content

Commit

Permalink
Fix Failures After Merge
Browse files Browse the repository at this point in the history
Signed-off-by: Mahad Zaryab <[email protected]>
  • Loading branch information
mahadzaryab1 committed Dec 27, 2024
1 parent 59709d4 commit f189b90
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
8 changes: 0 additions & 8 deletions cmd/query/app/http_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -361,14 +361,6 @@ func (aH *APIHandler) metrics(w http.ResponseWriter, r *http.Request, getMetrics
aH.writeJSON(w, r, m)
}

func (aH *APIHandler) convertModelToUI(trc *model.Trace, adjust bool) *ui.Trace {
if adjust {
aH.queryService.Adjust(trc)
}
uiTrace := uiconv.FromDomain(trc)
return uiTrace
}

func (*APIHandler) deduplicateDependencies(dependencies []model.DependencyLink) []ui.DependencyLink {
type Key struct {
parent string
Expand Down
5 changes: 4 additions & 1 deletion cmd/query/app/http_handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,10 @@ func TestGetTrace(t *testing.T) {

ts := initializeTestServer(t, HandlerOptions.Tracer(jTracer.OTEL))

ts.spanReader.On("GetTrace", mock.AnythingOfType("*context.valueCtx"), spanstore.GetTraceParameters{TraceID: model.NewTraceID(0, 0x123456abc)}).
ts.spanReader.On("GetTrace", mock.AnythingOfType("*context.valueCtx"), spanstore.GetTraceParameters{
TraceID: model.NewTraceID(0, 0x123456abc),
RawTraces: testCase.suffix == "?raw=true",
}).
Return(makeMockTrace(t), nil).Once()

var response structuredResponse
Expand Down
9 changes: 3 additions & 6 deletions cmd/query/app/querysvc/query_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ func (qs QueryService) GetTrace(ctx context.Context, query spanstore.GetTracePar
return nil, err
}
if !query.RawTraces {
trace, err = qs.adjust(trace)
qs.adjust(trace)
}
return trace, err
return trace, nil

Check warning on line 83 in cmd/query/app/querysvc/query_service.go

View check run for this annotation

Codecov / codecov/patch

cmd/query/app/querysvc/query_service.go#L77-L83

Added lines #L77 - L83 were not covered by tests
}

// GetServices is the queryService implementation of spanstore.Reader.GetServices
Expand Down Expand Up @@ -113,10 +113,7 @@ func (qs QueryService) FindTraces(ctx context.Context, query *spanstore.TraceQue
traces, err := spanReader.FindTraces(ctx, query)
if !query.RawTraces {
for _, trace := range traces {
_, err := qs.adjust(trace)
if err != nil {
return nil, err
}
qs.adjust(trace)
}

Check warning on line 117 in cmd/query/app/querysvc/query_service.go

View check run for this annotation

Codecov / codecov/patch

cmd/query/app/querysvc/query_service.go#L113-L117

Added lines #L113 - L117 were not covered by tests
}
return traces, err

Check warning on line 119 in cmd/query/app/querysvc/query_service.go

View check run for this annotation

Codecov / codecov/patch

cmd/query/app/querysvc/query_service.go#L119

Added line #L119 was not covered by tests
Expand Down

0 comments on commit f189b90

Please sign in to comment.