(t *testing.T)
| 537 | } |
| 538 | |
| 539 | func TestDoSearch(t *testing.T) { |
| 540 | seed := time.Date(2008, 1, 1, 12, 0, 0, 0, time.UTC) |
| 541 | traceInfo := util.NewTraceInfo(seed, "test") |
| 542 | |
| 543 | // Define the configuration |
| 544 | config := vultureConfiguration{ |
| 545 | tempoOrgID: "orgID", |
| 546 | // This is a hack to ensure the trace is "ready" |
| 547 | tempoWriteBackoffDuration: -time.Hour * 10000, |
| 548 | tempoRetentionDuration: time.Second * 10, |
| 549 | } |
| 550 | |
| 551 | logger = zap.NewNop() |
| 552 | |
| 553 | searchResponse := []*tempopb.TraceSearchMetadata{ |
| 554 | { |
| 555 | SpanSets: []*tempopb.SpanSet{ |
| 556 | { |
| 557 | Spans: []*tempopb.Span{ |
| 558 | { |
| 559 | SpanID: traceInfo.HexID(), |
| 560 | StartTimeUnixNano: 1000000000000, |
| 561 | DurationNanos: 1000000000, |
| 562 | Name: "", |
| 563 | Attributes: []*v1_common.KeyValue{ |
| 564 | {Key: "foo", Value: &v1_common.AnyValue{Value: &v1_common.AnyValue_StringValue{StringValue: "Bar"}}}, |
| 565 | }, |
| 566 | }, |
| 567 | }, |
| 568 | }, |
| 569 | }, |
| 570 | }, |
| 571 | } |
| 572 | |
| 573 | mockHTTPClient := MockHTTPClient{err: nil, searchResponse: searchResponse} |
| 574 | |
| 575 | doSearch(&mockHTTPClient, config, traceInfo, logger) |
| 576 | assert.Greater(t, mockHTTPClient.GetSearchesCount(), 0) |
| 577 | } |
| 578 | |
| 579 | func TestDoSearchError(t *testing.T) { |
| 580 | seed := time.Date(2008, 1, 1, 12, 0, 0, 0, time.UTC) |
nothing calls this directly
no test coverage detected