Prevent excessive log in tests

I had been unhappy with the fact that our go-test output had a lot of debug log messages which obfuscated test results.

I'm finally removeing all those by directing the test log output to io.Discard.

Signed-off-by: Yusuke Kuoka <ykuoka@gmail.com>
This commit is contained in:
Yusuke Kuoka
2022-10-11 06:19:32 +09:00
parent 31da58fa3c
commit 31cd729fd4
10 changed files with 56 additions and 56 deletions
+2 -2
View File
@@ -2,7 +2,7 @@ package state
import (
"fmt"
"os"
"io"
"reflect"
"testing"
@@ -73,7 +73,7 @@ func TestStorage_resolveFile(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
st := NewStorage(cacheDir, helmexec.NewLogger(os.Stderr, "debug"), filesystem.DefaultFileSystem())
st := NewStorage(cacheDir, helmexec.NewLogger(io.Discard, "debug"), filesystem.DefaultFileSystem())
files, skipped, err := st.resolveFile(tt.args.missingFileHandler, tt.args.title, tt.args.path)
if (err != nil) != tt.wantErr {