Adding stderr to client tests output. Exiting with error so make will fail. (#5168)
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
9cc37e6918
Коммит
d1f0cacdc9
@@ -60,18 +60,34 @@ func executeTestCommand(cmd *exec.Cmd) {
|
|||||||
cmdOutPipe, err := cmd.StdoutPipe()
|
cmdOutPipe, err := cmd.StdoutPipe()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
CommandPrintErrorln("Failed to run tests")
|
CommandPrintErrorln("Failed to run tests")
|
||||||
|
os.Exit(1)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
cmdErrOutPipe, err := cmd.StderrPipe()
|
||||||
|
if err != nil {
|
||||||
|
CommandPrintErrorln("Failed to run tests")
|
||||||
|
os.Exit(1)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
cmdOutReader := bufio.NewScanner(cmdOutPipe)
|
cmdOutReader := bufio.NewScanner(cmdOutPipe)
|
||||||
|
cmdErrOutReader := bufio.NewScanner(cmdErrOutPipe)
|
||||||
go func() {
|
go func() {
|
||||||
for cmdOutReader.Scan() {
|
for cmdOutReader.Scan() {
|
||||||
fmt.Println(cmdOutReader.Text())
|
fmt.Println(cmdOutReader.Text())
|
||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
|
go func() {
|
||||||
|
for cmdErrOutReader.Scan() {
|
||||||
|
fmt.Println(cmdErrOutReader.Text())
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
if err := cmd.Run(); err != nil {
|
if err := cmd.Run(); err != nil {
|
||||||
CommandPrintErrorln("Client Tests failed")
|
CommandPrintErrorln("Client Tests failed")
|
||||||
|
os.Exit(1)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user