Add ApplyEnvVars test to disk config
License: MIT Signed-off-by: Robert Ignat <robert.ignat91@gmail.com>
This commit is contained in:
parent
bac982c5aa
commit
08580c3d5c
|
@ -2,7 +2,9 @@ package disk
|
|||
|
||||
import (
|
||||
"encoding/json"
|
||||
"os"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
var cfgJSON = []byte(`
|
||||
|
@ -81,3 +83,13 @@ func TestDefault(t *testing.T) {
|
|||
t.Fatal("MetricRepoSize is a valid type")
|
||||
}
|
||||
}
|
||||
|
||||
func TestApplyEnvVars(t *testing.T) {
|
||||
os.Setenv("CLUSTER_DISK_METRICTTL", "22s")
|
||||
cfg := &Config{}
|
||||
cfg.ApplyEnvVars()
|
||||
|
||||
if cfg.MetricTTL != 22*time.Second {
|
||||
t.Fatal("failed to override metric_ttl with env var")
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user