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

Function TestHandleGetAttributeNames

modules/frontend/mcp_tools_test.go:324–369  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

322}
323
324func TestHandleGetAttributeNames(t *testing.T) {
325 server, callAndTestResults := testFrontend()
326
327 tests := []struct {
328 name string
329 request mcp.CallToolRequest
330 expected expectedResult
331 }{
332 {
333 name: "no scope",
334 request: callToolRequest(map[string]any{}),
335 expected: expectedResult{
336 path: "/api/v2/search/tags",
337 params: map[string]string{},
338 meta: map[string]any{
339 "type": "attribute-names",
340 "encoding": "json",
341 "version": "2",
342 },
343 },
344 },
345 {
346 name: "with scope",
347 request: callToolRequest(map[string]any{
348 "scope": "span",
349 }),
350 expected: expectedResult{
351 path: "/api/v2/search/tags",
352 params: map[string]string{
353 "scope": "span",
354 },
355 meta: map[string]any{
356 "type": "attribute-names",
357 "encoding": "json",
358 "version": "2",
359 },
360 },
361 },
362 }
363
364 for _, tt := range tests {
365 t.Run(tt.name, func(t *testing.T) {
366 callAndTestResults(t, tt.request, server.handleGetAttributeNames, tt.expected)
367 })
368 }
369}
370
371func TestHandleGetAttributeValues(t *testing.T) {
372 server, callAndTestResults := testFrontend()

Callers

nothing calls this directly

Calls 3

testFrontendFunction · 0.85
callToolRequestFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected