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 54ee22b
Show file tree
Hide file tree
Showing 4 changed files with 19 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
9 changes: 9 additions & 0 deletions integration/embed_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,15 @@ func TestEmbedEtcd(t *testing.T) {
}

tests[0].cfg.Durl = "abc"
tests[0].cfg.Logger = "zap"
tests[0].cfg.LogOutput = "io-discard"
tests[0].cfg.Debug = false

setupEmbedCfg(&tests[1].cfg, []url.URL{urls[0]}, []url.URL{urls[1]})
tests[1].cfg.ACUrls = nil
tests[2].cfg.TickMs = tests[2].cfg.ElectionMs - 1
tests[3].cfg.ElectionMs = 999999

setupEmbedCfg(&tests[4].cfg, []url.URL{urls[2]}, []url.URL{urls[3]})
setupEmbedCfg(&tests[5].cfg, []url.URL{urls[4]}, []url.URL{urls[5], urls[6]})
setupEmbedCfg(&tests[6].cfg, []url.URL{urls[7], urls[8]}, []url.URL{urls[9]})
Expand Down Expand Up @@ -175,6 +180,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 54ee22b

Please sign in to comment.