Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Leung <[email protected]>
  • Loading branch information
rleungx authored and ti-chi-bot committed May 8, 2024
1 parent 683decf commit 9802c1f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions server/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,22 @@ tso-update-physical-interval = "15s"
re.NoError(err)

re.Equal(maxTSOUpdatePhysicalInterval, cfg.TSOUpdatePhysicalInterval.Duration)

cfgData = `
[log]
level = "debug"
`
flagSet = pflag.NewFlagSet("testlog", pflag.ContinueOnError)
flagSet.StringP("log-level", "L", "info", "log level: debug, info, warn, error, fatal (default 'info')")
flagSet.Parse(nil)
cfg = NewConfig()
err = cfg.Parse(flagSet)
re.NoError(err)
meta, err = toml.Decode(cfgData, &cfg)
re.NoError(err)
err = cfg.Adjust(&meta, false)
re.NoError(err)
re.Equal("debug", cfg.Log.Level)
}

func TestMigrateFlags(t *testing.T) {
Expand Down

0 comments on commit 9802c1f

Please sign in to comment.