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()
|
||||
if err != nil {
|
||||
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
|
||||
}
|
||||
|
||||
cmdOutReader := bufio.NewScanner(cmdOutPipe)
|
||||
cmdErrOutReader := bufio.NewScanner(cmdErrOutPipe)
|
||||
go func() {
|
||||
for cmdOutReader.Scan() {
|
||||
fmt.Println(cmdOutReader.Text())
|
||||
}
|
||||
}()
|
||||
|
||||
go func() {
|
||||
for cmdErrOutReader.Scan() {
|
||||
fmt.Println(cmdErrOutReader.Text())
|
||||
}
|
||||
}()
|
||||
|
||||
if err := cmd.Run(); err != nil {
|
||||
CommandPrintErrorln("Client Tests failed")
|
||||
os.Exit(1)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user