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

Function TestParseTraceIDs

cmd/tempo-cli/cmd-redact_test.go:54–69  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

52}
53
54func TestParseTraceIDs(t *testing.T) {
55 t.Run("valid", func(t *testing.T) {
56 ids, err := parseTraceIDs([]string{
57 "931281e2a09876de16e15f45ff86283d",
58 "00000000000000000000000000000001",
59 })
60 require.NoError(t, err)
61 require.Len(t, ids, 2)
62 })
63
64 t.Run("invalid hex", func(t *testing.T) {
65 _, err := parseTraceIDs([]string{"not-a-trace-id"})
66 require.Error(t, err)
67 require.Contains(t, err.Error(), "invalid trace ID")
68 })
69}

Callers

nothing calls this directly

Calls 4

parseTraceIDsFunction · 0.85
LenMethod · 0.65
ErrorMethod · 0.65
RunMethod · 0.45

Tested by

no test coverage detected