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 := exec.Command(goBin, opts.goArgs()...)
|
||||||
cmd.Env = opts.goEnv()
|
cmd.Env = opts.goEnv()
|
||||||
out, err := cmd.StdoutPipe()
|
out, err := cmd.StdoutPipe()
|
||||||
defer out.Close()
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -202,6 +201,13 @@ func (c *Run) runTest(opts *runOpts) (*TestReport, error) {
|
||||||
return nil, err
|
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)
|
dec := NewDecoder(out)
|
||||||
report, err := dec.Decode(c.logger.Named("run.gotest"))
|
report, err := dec.Decode(c.logger.Named("run.gotest"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue