mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Adding stderr to client tests output. Exiting with error so make will fail. (#5168)
This commit is contained in:
committed by
Joram Wilander
parent
9cc37e6918
commit
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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user