()
| 257 | } |
| 258 | |
| 259 | func newTestCombiner() *genericCombiner[*tempopb.ServiceStats] { |
| 260 | count := 0 |
| 261 | |
| 262 | gc := &genericCombiner[*tempopb.ServiceStats]{ |
| 263 | new: func() *tempopb.ServiceStats { return &tempopb.ServiceStats{} }, |
| 264 | current: nil, |
| 265 | combine: func(_, _ *tempopb.ServiceStats, _ PipelineResponse) error { |
| 266 | count++ |
| 267 | return nil |
| 268 | }, |
| 269 | finalize: func(_ *tempopb.ServiceStats) (*tempopb.ServiceStats, error) { |
| 270 | return &tempopb.ServiceStats{ |
| 271 | SpanCount: uint32(count), |
| 272 | ErrorCount: uint32(count), |
| 273 | }, nil |
| 274 | }, |
| 275 | quit: func(_ *tempopb.ServiceStats) bool { |
| 276 | return false |
| 277 | }, |
| 278 | diff: func(_ *tempopb.ServiceStats) (*tempopb.ServiceStats, error) { |
| 279 | return &tempopb.ServiceStats{ |
| 280 | SpanCount: uint32(count), |
| 281 | ErrorCount: uint32(count), |
| 282 | }, nil |
| 283 | }, |
| 284 | } |
| 285 | initHTTPCombiner(gc, api.MarshallingFormatJSON) |
| 286 | return gc |
| 287 | } |
| 288 | |
| 289 | // Helper functions for creating test responses with different marshaling formats |
| 290 | func toHTTPResponseWithFormat(t *testing.T, pb proto.Message, statusCode int, responseData any, format api.MarshallingFormat) PipelineResponse { |
no test coverage detected