Skip to content

Commit

Permalink
integration,embed: ignore embed log output
Browse files Browse the repository at this point in the history
Signed-off-by: Gyuho Lee <[email protected]>
  • Loading branch information
gyuho committed Apr 16, 2018
1 parent eb3cd80 commit e68bf1e
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
9 changes: 9 additions & 0 deletions embed/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,16 @@ func TestConfigFileOtherFields(t *testing.T) {
ClientSecurityCfgFile securityConfig `json:"client-transport-security"`
PeerSecurityCfgFile securityConfig `json:"peer-transport-security"`
ForceNewCluster bool `json:"force-new-cluster"`
Logger string `json:"logger"`
LogOutput string `json:"log-output"`
Debug bool `json:"debug"`
}{
ctls,
ptls,
true,
"zap",
"io-discard",
false,
}

b, err := yaml.Marshal(&yc)
Expand Down Expand Up @@ -150,6 +156,9 @@ func mustCreateCfgFile(t *testing.T, b []byte) *os.File {

func TestAutoCompactionModeInvalid(t *testing.T) {
cfg := NewConfig()
cfg.Logger = "zap"
cfg.LogOutput = "io-discard"
cfg.Debug = false
cfg.AutoCompactionMode = "period"
err := cfg.Validate()
if err == nil {
Expand Down
5 changes: 0 additions & 5 deletions integration/cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ import (
"github.com/coreos/etcd/client"
"github.com/coreos/etcd/etcdserver"
"github.com/coreos/etcd/pkg/testutil"

"github.com/coreos/pkg/capnslog"
)

func init() {
Expand Down Expand Up @@ -456,9 +454,6 @@ func TestRejectUnhealthyRemove(t *testing.T) {
func TestRestartRemoved(t *testing.T) {
defer testutil.AfterTest(t)

capnslog.SetGlobalLogLevel(capnslog.INFO)
defer capnslog.SetGlobalLogLevel(defaultLogLevel)

// 1. start single-member cluster
c := NewCluster(t, 1)
for _, m := range c.Members {
Expand Down
8 changes: 8 additions & 0 deletions integration/embed_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ func TestEmbedEtcd(t *testing.T) {
// setup defaults
for i := range tests {
tests[i].cfg = *embed.NewConfig()
tests[i].cfg.Logger = "zap"
tests[i].cfg.LogOutput = "io-discard"
tests[i].cfg.Debug = false

}

tests[0].cfg.Durl = "abc"
Expand Down Expand Up @@ -175,6 +179,10 @@ func newEmbedURLs(secure bool, n int) (urls []url.URL) {
}

func setupEmbedCfg(cfg *embed.Config, curls []url.URL, purls []url.URL) {
cfg.Logger = "zap"
cfg.LogOutput = "io-discard"
cfg.Debug = false

cfg.ClusterState = "new"
cfg.LCUrls, cfg.ACUrls = curls, curls
cfg.LPUrls, cfg.APUrls = purls, purls
Expand Down
1 change: 1 addition & 0 deletions integration/member_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (

func TestPauseMember(t *testing.T) {
defer testutil.AfterTest(t)

c := NewCluster(t, 5)
c.Launch(t)
defer c.Terminate(t)
Expand Down

0 comments on commit e68bf1e

Please sign in to comment.