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
+4 -4
View File
@@ -2,7 +2,7 @@ package remote
import (
"fmt"
"os"
"io"
"path/filepath"
"testing"
@@ -55,7 +55,7 @@ func TestRemote_HttpsGitHub(t *testing.T) {
get: get,
}
remote := &Remote{
Logger: helmexec.NewLogger(os.Stderr, "debug"),
Logger: helmexec.NewLogger(io.Discard, "debug"),
Home: CacheDir(),
Getter: getter,
fs: testfs.ToFileSystem(),
@@ -131,7 +131,7 @@ func TestRemote_SShGitHub(t *testing.T) {
get: get,
}
remote := &Remote{
Logger: helmexec.NewLogger(os.Stderr, "debug"),
Logger: helmexec.NewLogger(io.Discard, "debug"),
Home: CacheDir(),
Getter: getter,
fs: testfs.ToFileSystem(),
@@ -201,7 +201,7 @@ func TestRemote_SShGitHub_WithSshKey(t *testing.T) {
get: get,
}
remote := &Remote{
Logger: helmexec.NewLogger(os.Stderr, "debug"),
Logger: helmexec.NewLogger(io.Discard, "debug"),
Home: CacheDir(),
Getter: getter,
fs: testfs.ToFileSystem(),