mirror of
https://github.com/prometheus/node_exporter.git
synced 2024-12-04 07:51:04 +01:00
Suppress log noise from textfile collector test.
This commit is contained in:
parent
60dffaa9ff
commit
24c9db9600
@ -14,6 +14,7 @@
|
|||||||
package collector
|
package collector
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"flag"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"sort"
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
@ -46,6 +47,13 @@ func TestParseTextFiles(t *testing.T) {
|
|||||||
path: test.path,
|
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()
|
mfs := c.parseTextFiles()
|
||||||
textMFs := make([]string, 0, len(mfs))
|
textMFs := make([]string, 0, len(mfs))
|
||||||
for _, mf := range mfs {
|
for _, mf := range mfs {
|
||||||
|
Loading…
Reference in New Issue
Block a user