fix: logs

This commit is contained in:
debugtalk
2022-10-23 16:41:23 +08:00
parent 3848c486be
commit be8d8b5c5d
6 changed files with 29 additions and 14 deletions

View File

@@ -226,11 +226,22 @@ func (r *HRPRunner) Run(testcases ...ITestCase) error {
// each run has its own session runner
sessionRunner := caseRunner.NewSession()
err1 := sessionRunner.Start(it.Next())
caseSummary, err2 := sessionRunner.GetSummary()
s.appendCaseSummary(caseSummary)
if err1 != nil || err2 != nil {
if err1 != nil {
log.Error().Err(err1).Msg("[Run] run testcase failed")
runErr = err1
}
caseSummary, err2 := sessionRunner.GetSummary()
s.appendCaseSummary(caseSummary)
if err2 != nil {
log.Error().Err(err2).Msg("[Run] get summary failed")
if err1 != nil {
runErr = errors.Wrap(err1, err2.Error())
} else {
runErr = err2
}
}
if runErr != nil && r.failfast {
break
}
}