Commit d0ad709b authored by ethfoo's avatar ethfoo
Browse files

Test: sort interceptors in TestMergeDefault

No related merge requests found
Showing with 9 additions and 2 deletions
+9 -2
......@@ -33,8 +33,6 @@ import (
"github.com/loggie-io/loggie/pkg/pipeline"
)
var ErrOutOfReloadPeriod = errors.New("out of reload period")
type Reloader struct {
controller *control.Controller
......
......@@ -13,6 +13,7 @@ import (
"github.com/loggie-io/loggie/pkg/sink/codec"
"github.com/loggie-io/loggie/pkg/util/yaml"
"github.com/stretchr/testify/assert"
"sort"
"testing"
"time"
)
......@@ -117,6 +118,14 @@ pipelines:
},
}
sort.Slice(pipe.Pipelines[0].Interceptors, func(i, j int) bool {
return pipe.Pipelines[0].Interceptors[i].Type > pipe.Pipelines[0].Interceptors[j].Type
})
sort.Slice(want.Pipelines[0].Interceptors, func(i, j int) bool {
return want.Pipelines[0].Interceptors[i].Type > want.Pipelines[0].Interceptors[j].Type
})
assert.Equal(t, want, pipe)
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment