fix(config): actually load threshold config (#696)
* fix(config): actually load threshold config Signed-off-by: Xe Iaso <me@xeiaso.net> * chore: spelling Signed-off-by: Xe Iaso <me@xeiaso.net> * test(lib): fix test failures Signed-off-by: Xe Iaso <me@xeiaso.net> --------- Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
parent
226cf36bf7
commit
7aa732c700
12 changed files with 201 additions and 30 deletions
|
|
@ -3,6 +3,8 @@ package config
|
|||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
)
|
||||
|
||||
|
|
@ -90,3 +92,20 @@ func TestDefaultThresholdsValid(t *testing.T) {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestLoadActuallyLoadsThresholds(t *testing.T) {
|
||||
fin, err := os.Open(filepath.Join(".", "testdata", "good", "thresholds.yaml"))
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
defer fin.Close()
|
||||
|
||||
c, err := Load(fin, fin.Name())
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if len(c.Thresholds) != 4 {
|
||||
t.Errorf("wanted 4 thresholds, got %d thresholds", len(c.Thresholds))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue