From 24c9db9600adeb390f6c1b669d2fe6c7d8f78573 Mon Sep 17 00:00:00 2001 From: Matthias Rampke Date: Sat, 26 Sep 2015 20:15:42 +0200 Subject: [PATCH] Suppress log noise from textfile collector test. --- collector/textfile_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/collector/textfile_test.go b/collector/textfile_test.go index d2938b73..a27ce0f2 100644 --- a/collector/textfile_test.go +++ b/collector/textfile_test.go @@ -14,6 +14,7 @@ package collector import ( + "flag" "io/ioutil" "sort" "strings" @@ -46,6 +47,13 @@ func TestParseTextFiles(t *testing.T) { path: test.path, } + // Suppress a log message about `nonexistent_path` not existing, this is + // expected and clutters the test output. + err := flag.Set("log.level", "fatal") + if err != nil { + t.Fatal(err) + } + mfs := c.parseTextFiles() textMFs := make([]string, 0, len(mfs)) for _, mf := range mfs {