Skip to content

Commit

Permalink
Remove commented out unit tests and add some more
Browse files Browse the repository at this point in the history
Signed-off-by: Michel Hollands <michel.hollands@grafana.com>
  • Loading branch information
MichelHollands committed Apr 22, 2022
1 parent e3bc524 commit 48166fb
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions pkg/storage/stores/shipper/compactor/deletion/validation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,15 @@ func TestParseLogQLExpressionForDeletion(t *testing.T) {
require.NoError(t, err)
})

/* syntax.ParseLogSelector does not reject these
t.Run("pipeline expression with label filter ", func(t *testing.T) {
logSelectorExpr, err := parseDeletionQuery(`{env="dev", secret="true"} | json bob="top.params[0]"`)
require.Nil(t, logSelectorExpr)
require.ErrorIs(t, err, errUnsupportedQuery)
t.Run("pipeline expression with multiple line filters", func(t *testing.T) {
logSelectorExpr, err := parseDeletionQuery(`{env="dev", secret="true"} |= "social sec number" |~ "[abd]*" `)
require.NotNil(t, logSelectorExpr)
require.NoError(t, err)
})

t.Run("metrics query", func(t *testing.T) {
logSelectorExpr, err := parseDeletionQuery(`count_over_time({job="mysql"}[5m])`)
t.Run("pipeline expression with invalid line filter", func(t *testing.T) {
logSelectorExpr, err := parseDeletionQuery(`{env="dev", secret="true"} |= social sec number`)
require.Nil(t, logSelectorExpr)
require.ErrorIs(t, err, errUnsupportedQuery)
require.ErrorIs(t, err, errInvalidQuery)
})
*/
}

0 comments on commit 48166fb

Please sign in to comment.