e2e/cli/command: Wait() after execution
This commit is contained in:
parent
a046a96d5e
commit
c9383ca17d
|
@ -192,7 +192,6 @@ func (c *Run) runTest(opts *runOpts) (*TestReport, error) {
|
|||
cmd := exec.Command(goBin, opts.goArgs()...)
|
||||
cmd.Env = opts.goEnv()
|
||||
out, err := cmd.StdoutPipe()
|
||||
defer out.Close()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
@ -202,6 +201,13 @@ func (c *Run) runTest(opts *runOpts) (*TestReport, error) {
|
|||
return nil, err
|
||||
}
|
||||
|
||||
err = cmd.Wait()
|
||||
if err != nil {
|
||||
// should command fail, log here then proceed to generate test report
|
||||
// to report more informative info about which tests fail
|
||||
c.logger.Error("test command failed", "error", err)
|
||||
}
|
||||
|
||||
dec := NewDecoder(out)
|
||||
report, err := dec.Decode(c.logger.Named("run.gotest"))
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in a new issue