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 -4
View File
@@ -1,13 +1,11 @@
package app
import (
"os"
"strings"
"testing"
"gopkg.in/yaml.v3"
"github.com/helmfile/helmfile/pkg/helmexec"
"github.com/helmfile/helmfile/pkg/remote"
"github.com/helmfile/helmfile/pkg/state"
"github.com/helmfile/helmfile/pkg/testhelper"
@@ -16,12 +14,12 @@ import (
// nolint: unparam
func makeLoader(files map[string]string, env string) (*desiredStateLoader, *testhelper.TestFs) {
testfs := testhelper.NewTestFs(files)
logger := helmexec.NewLogger(os.Stdout, "debug")
logger := newAppTestLogger()
r := remote.NewRemote(logger, testfs.Cwd, testfs.ToFileSystem())
return &desiredStateLoader{
env: env,
namespace: "namespace",
logger: helmexec.NewLogger(os.Stdout, "debug"),
logger: newAppTestLogger(),
fs: testfs.ToFileSystem(),
remote: r,
}, testfs