From 5df1b2985251117aa9b70cb5610afaed28b94ffe Mon Sep 17 00:00:00 2001 From: Karsten Jeschkies Date: Mon, 13 Nov 2023 13:17:15 +0100 Subject: [PATCH] Test multiple filters --- pkg/logql/serialize_test.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/logql/serialize_test.go b/pkg/logql/serialize_test.go index 7642026a272df..36af5d0a1dde7 100644 --- a/pkg/logql/serialize_test.go +++ b/pkg/logql/serialize_test.go @@ -2,7 +2,6 @@ package logql import ( "bytes" - "fmt" "testing" "github.com/stretchr/testify/require" @@ -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.*"`, @@ -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()) }) }