Skip to content

Commit e951063

Browse files
committed
fix(tests): remove unneeded logging from ClearTestSession()
1 parent eab8cdf commit e951063

2 files changed

Lines changed: 9 additions & 13 deletions

File tree

tests/dockercliutils/dockercliutils.go

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func PrintToStdout(t *testing.T, stdout *io.PipeReader,
126126
func BuildImage(t *testing.T, path string, tag string) error {
127127
var err error
128128
cli, stdout, stdoutPipe := GetNewClient()
129-
fmt.Println("Building docker image", tag)
129+
fmt.Println("--- Build docker image", tag)
130130
go func() {
131131
if err = cli.CmdBuild("--tag="+tag, path); err != nil {
132132
return
@@ -206,7 +206,6 @@ func RunDeisDataTest(t *testing.T, args ...string) {
206206
}
207207
}()
208208
go func() {
209-
fmt.Println("closing read/write pipe")
210209
time.Sleep(3000 * time.Millisecond)
211210
if err := CloseWrap(stdout, stdoutPipe); err != nil {
212211
t.Fatalf("Inspect Element %s", err)
@@ -229,15 +228,14 @@ func getContainerIds(t *testing.T, uid string) []string {
229228
}
230229
}()
231230
for {
232-
if cmdBytes, err := bufio.NewReader(stdout).ReadString('\n'); err == nil {
233-
fmt.Print(cmdBytes)
234-
if strings.Contains(cmdBytes, uid) {
235-
sliceContainers = utils.Append(sliceContainers, strings.Fields(cmdBytes)[0])
236-
}
237-
} else {
231+
cmdBytes, err := bufio.NewReader(stdout).ReadString('\n')
232+
if err != nil {
238233
break
239234
}
240-
235+
if strings.Contains(cmdBytes, uid) {
236+
sliceContainers = utils.Append(
237+
sliceContainers, strings.Fields(cmdBytes)[0])
238+
}
241239
}
242240
return sliceContainers
243241
}
@@ -272,8 +270,7 @@ func stopContainers(t *testing.T, sliceContainerIds []string) {
272270
cli, stdout, stdoutPipe := GetNewClient()
273271
go func() {
274272
for _, value := range sliceContainerIds {
275-
err := cli.CmdStop(value)
276-
if err != nil {
273+
if err := cli.CmdStop(value); err != nil {
277274
t.Log("stop container failed:", err)
278275
}
279276
}
@@ -327,7 +324,6 @@ func RunEtcdTest(t *testing.T, uid string, port string) {
327324
}()
328325
go func() {
329326
<-done2
330-
fmt.Println("closing read/write pipe")
331327
time.Sleep(5000 * time.Millisecond)
332328
if err := CloseWrap(stdout, stdoutPipe); err != nil {
333329
t.Fatalf("runEtcdTest %s", err)

tests/etcdutils/etcdutils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ func SetEtcdValues(t *testing.T, keys []string, values []string, c *etcd.Client)
4242
}
4343

4444
func Publishvalues(t *testing.T, ecli *EtcdHandle) {
45-
fmt.Println("Publishing ETCD Key values")
45+
fmt.Println("--- Publish etcd keys and values")
4646
for _, dir := range ecli.Dirs {
4747
_, err := ecli.C.SetDir(dir, 0)
4848
if err != nil {

0 commit comments

Comments
 (0)