MCPcopy Create free account
hub / github.com/cortexproject/cortex / TestDecodeLabelOrder

Function TestDecodeLabelOrder

pkg/ruler/frontend_decoder_test.go:17–37  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

15)
16
17func TestDecodeLabelOrder(t *testing.T) {
18 j := JsonDecoder{}
19
20 decoded := j.vectorToPromQLVector(
21 model.Vector{
22 {
23 Metric: model.Metric{
24 "foo": "bar",
25 "a": "b",
26 "b": "b",
27 },
28 Timestamp: 1724146338123,
29 Value: 1.234,
30 },
31 },
32 )
33 require.Equal(t, 1, len(decoded))
34 require.Equal(t, int64(1724146338123), decoded[0].T)
35 require.Equal(t, 1.234, decoded[0].F)
36 require.Equal(t, labels.FromStrings("a", "b", "b", "b", "foo", "bar"), decoded[0].Metric)
37}
38
39func TestProtoDecode(t *testing.T) {
40 tests := []struct {

Callers

nothing calls this directly

Calls 2

vectorToPromQLVectorMethod · 0.95
EqualMethod · 0.65

Tested by

no test coverage detected