1
0
Fork 0
mirror of https://github.com/eosswedenorg/thalos synced 2026-06-19 04:50:02 +02:00

cmd/thalos/main.go: move cli flags to internal/config/cli.go as it is easier to write tests if we can get a hold of the flags.

This commit is contained in:
Henrik Hautakoski 2024-02-18 11:44:19 +01:00
parent 117f1b50b4
commit beb5b6cf04
3 changed files with 18 additions and 16 deletions

View file

@ -6,7 +6,6 @@ import (
"time"
"github.com/eosswedenorg/thalos/internal/log"
"github.com/spf13/pflag"
"github.com/stretchr/testify/require"
shipclient "github.com/eosswedenorg-go/antelope-ship-client"
@ -132,14 +131,13 @@ redis:
}
func TestBuilder_Flags(t *testing.T) {
flags := pflag.FlagSet{}
flags.StringP("log", "l", "", "")
flags := GetFlags()
require.NoError(t, flags.Set("log", "/path/to/logs"))
cfg, err := NewBuilder().
SetSource(bytes.NewReader([]byte(``))).
SetFlags(&flags).
SetFlags(flags).
Build()
expected := New()