MCPcopy
hub / github.com/grafana/tempo / TestBuildSearchBlockRequest

Function TestBuildSearchBlockRequest

pkg/api/http_test.go:437–520  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

435}
436
437func TestBuildSearchBlockRequest(t *testing.T) {
438 tests := []struct {
439 req *tempopb.SearchBlockRequest
440 httpReq *http.Request
441 query string
442 }{
443 {
444 req: &tempopb.SearchBlockRequest{
445 StartPage: 0,
446 PagesToSearch: 10,
447 BlockID: "b92ec614-3fd7-4299-b6db-f657e7025a9b",
448 IndexPageSize: 10,
449 TotalRecords: 11,
450 Version: "v2",
451 Size_: 1000,
452 FooterSize: 2000,
453 },
454 query: "?blockID=b92ec614-3fd7-4299-b6db-f657e7025a9b&pagesToSearch=10&size=1000&startPage=0&encoding=none&indexPageSize=10&totalRecords=11&version=v2&footerSize=2000",
455 },
456 {
457 req: &tempopb.SearchBlockRequest{
458 StartPage: 0,
459 PagesToSearch: 10,
460 BlockID: "b92ec614-3fd7-4299-b6db-f657e7025a9b",
461 IndexPageSize: 10,
462 TotalRecords: 11,
463 Version: "v2",
464 Size_: 1000,
465 FooterSize: 2000,
466 },
467 httpReq: httptest.NewRequest("GET", "/test/path", nil),
468 query: "/test/path?blockID=b92ec614-3fd7-4299-b6db-f657e7025a9b&pagesToSearch=10&size=1000&startPage=0&encoding=none&indexPageSize=10&totalRecords=11&version=v2&footerSize=2000",
469 },
470 {
471 req: &tempopb.SearchBlockRequest{
472 SearchReq: &tempopb.SearchRequest{
473 Tags: map[string]string{
474 "foo": "bar",
475 },
476 Start: 10,
477 End: 20,
478 MinDurationMs: 30,
479 MaxDurationMs: 40,
480 Limit: 50,
481 },
482 StartPage: 0,
483 PagesToSearch: 10,
484 BlockID: "b92ec614-3fd7-4299-b6db-f657e7025a9b",
485 IndexPageSize: 10,
486 TotalRecords: 11,
487 Version: "v2",
488 Size_: 1000,
489 FooterSize: 2000,
490 },
491 query: "?start=10&end=20&limit=50&maxDuration=40ms&minDuration=30ms&spss=0&tags=foo%3Dbar&blockID=b92ec614-3fd7-4299-b6db-f657e7025a9b&pagesToSearch=10&size=1000&startPage=0&encoding=none&indexPageSize=10&totalRecords=11&version=v2&footerSize=2000",
492 },
493 {
494 req: &tempopb.SearchBlockRequest{

Callers

nothing calls this directly

Calls 4

BuildSearchBlockRequestFunction · 0.85
MarshalMethod · 0.65
EqualMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected