Skip to content

Commit

Permalink
Two tests are left
Browse files Browse the repository at this point in the history
  • Loading branch information
jeschkies committed Nov 13, 2023
1 parent ce67404 commit 5a8ff21
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion pkg/logql/syntax/serialize.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ func (v *JSONSerializer) VisitBinOp(e *BinOpExpr) {
}

v.WriteObjectEnd()
v.Flush()

}

Expand Down Expand Up @@ -268,6 +269,7 @@ func encodeGrouping(s *jsoniter.Stream, g *Grouping) {
s.WriteObjectStart()
s.WriteObjectField("without")
s.WriteBool(g.Without)

s.WriteMore()
s.WriteObjectField("groups")
s.WriteArrayStart()
Expand Down Expand Up @@ -467,7 +469,6 @@ func encodeVectorMatching(s *jsoniter.Stream, vm *VectorMatching) {
s.WriteObjectEnd()
}


func decodeVectorMatching(iter *jsoniter.Iterator) *VectorMatching {
vm := &VectorMatching{}

Expand Down
4 changes: 2 additions & 2 deletions pkg/logql/syntax/serialize_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func TestJSONSerializationRoundTrip(t *testing.T) {
},
"post filters": {
query: `quantile_over_time(0.99998,{app="foo"} |= "bar" | json | latency >= 250ms or ( status_code < 500 and status_code > 200)
| line_format "blip{{ .foo }}blop {{.status_code}}" | label_format foo=bar,status_code="buzz{{.bar}}" | unwrap foo | __error__ !~".+"[5m]) by (namespace,instance)`,
| line_format "blip{{ .foo }}blop {{.status_code}}" | label_format foo=bar,status_code="buzz{{.bar}}" | unwrap foo | __error__ !~".+"[5m]) by (namespace,instance)`,
},
}

Expand All @@ -62,7 +62,7 @@ func TestJSONSerializationRoundTrip(t *testing.T) {
actual, err := DecodeJSON(buf.String())
require.NoError(t, err)

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

0 comments on commit 5a8ff21

Please sign in to comment.