Skip to content

Commit

Permalink
Test multiple filters
Browse files Browse the repository at this point in the history
  • Loading branch information
jeschkies committed Nov 13, 2023
1 parent 155cfb0 commit 5df1b29
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions pkg/logql/serialize_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package logql

import (
"bytes"
"fmt"
"testing"

"github.com/stretchr/testify/require"
Expand All @@ -27,7 +26,7 @@ func TestJSONSerializationRoundTrip(t *testing.T) {
query: `(count_over_time({env="prod", app=~"loki.*"}[5m]) >= 0)`,
},
"label filter": {
query: `sum_over_time({env="prod", app=~"loki.*"} | byte>128 | unwrap bytes[5m])`,
query: `{app="foo"} |= "bar" | json | ( latency>=250ms or ( status_code<500 , status_code>200 ) )`,
},
"regexp": {
query: `{env="prod", app=~"loki.*"} |~ ".*foo.*"`,
Expand All @@ -44,11 +43,11 @@ func TestJSONSerializationRoundTrip(t *testing.T) {
err = EncodeJSON(expr, &buf)
require.NoError(t, err)

t.Log(buf.String())

actual, err := DecodeJSON(buf.String())
require.NoError(t, err)

fmt.Println(buf.String())

require.Equal(t, test.query, actual.String())
})
}
Expand Down

0 comments on commit 5df1b29

Please sign in to comment.