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

Function TestListBlocksWithPrefix

tempodb/backend/azure/azure_test.go:312–463  ·  tempodb/backend/azure/azure_test.go::TestListBlocksWithPrefix
(t *testing.T)

Source from the content-addressed store, hash-verified

310}
311
312func TestListBlocksWithPrefix(t *testing.T) {
313 tests := []struct {
314 name string
315 prefix string
316 liveBlockIDs []uuid.UUID
317 compactedBlockIDs []uuid.UUID
318 tenant string
319 httpHandler func(t *testing.T) http.HandlerFunc
320 }{
321 {
322 name: "with prefix",
323 prefix: "a/b/c/",
324 tenant: "single-tenant",
325 liveBlockIDs: []uuid.UUID{uuid.MustParse("00000000-0000-0000-0000-000000000000")},
326 compactedBlockIDs: []uuid.UUID{uuid.MustParse("00000000-0000-0000-0000-000000000001")},
327 httpHandler: func(t *testing.T) http.HandlerFunc {
328 return func(w http.ResponseWriter, r *http.Request) {
329 if r.Method == "GET" {
330 assert.Equal(t, "a/b/c/single-tenant/", r.URL.Query().Get("prefix"))
331
332 _, _ = w.Write([]byte(`
333 <?xml version="1.0" encoding="utf-8"?>
334 <EnumerationResults ServiceEndpoint="http://myaccount.blob.core.windows.net/" ContainerName="mycontainer">
335 <Prefix>a/b/c/</Prefix>
336 <MaxResults>100</MaxResults>
337 <Blobs>
338 <Blob>
339 <Name>a/b/c/single-tenant/00000000-0000-0000-0000-000000000000/meta.json</Name>
340 <Url>https://myaccount.blob.core.windows.net/mycontainer/a/b/c/single-tenant/00000000-0000-0000-0000-000000000000/meta.json</Url>
341 <Properties>
342 <Last-Modified>Fri, 01 Mar 2024 00:00:00 GMT</Last-Modified>
343 <Etag>0x8CBFF45D8A29A19</Etag>
344 <Content-Length>100</Content-Length>
345 <Content-Type>text/html</Content-Type>
346 <Content-Encoding />
347 <Content-Language>en-US</Content-Language>
348 <Content-MD5 />
349 <Cache-Control>no-cache</Cache-Control>
350 <BlobType>BlockBlob</BlobType>
351 <LeaseStatus>unlocked</LeaseStatus>
352 </Properties>
353 </Blob>
354
355 <Blob>
356 <Name>a/b/c/single-tenant/00000000-0000-0000-0000-000000000001/meta.compacted.json</Name>
357 <Url>https://myaccount.blob.core.windows.net/mycontainer/a/b/c/single-tenant/00000000-0000-0000-0000-000000000001/meta.compacted.json</Url>
358 <Properties>
359 <Last-Modified>Fri, 01 Mar 2024 00:00:00 GMT</Last-Modified>
360 <Etag>0x8CBFF45D8A29A19</Etag>
361 <Content-Length>100</Content-Length>
362 <Content-Type>text/html</Content-Type>
363 <Content-Encoding />
364 <Content-Language>en-US</Content-Language>
365 <Content-MD5 />
366 <Cache-Control>no-cache</Cache-Control>
367 <BlobType>BlockBlob</BlobType>
368 <LeaseStatus>unlocked</LeaseStatus>
369 </Properties>

Callers

nothing calls this directly

Calls 8

QueryMethod · 0.80
testServerFunction · 0.70
NewNoConfirmFunction · 0.70
GetMethod · 0.65
WriteMethod · 0.65
ListBlocksMethod · 0.65
EqualMethod · 0.45
RunMethod · 0.45

Tested by

no test coverage detected