mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-07 05:32:43 +08:00
change: print exit code
This commit is contained in:
@@ -1 +1 @@
|
||||
v5.0.0-250630
|
||||
v5.0.0-250701
|
||||
|
||||
@@ -36,9 +36,7 @@ import (
|
||||
|
||||
// Run starts to run testcase with default configs.
|
||||
func Run(t *testing.T, testcases ...ITestCase) error {
|
||||
err := NewRunner(t).SetSaveTests(true).Run(testcases...)
|
||||
code.GetErrorCode(err)
|
||||
return err
|
||||
return NewRunner(t).SetSaveTests(true).Run(testcases...)
|
||||
}
|
||||
|
||||
// NewRunner constructs a new runner instance.
|
||||
@@ -234,7 +232,9 @@ func (r *HRPRunner) Run(testcases ...ITestCase) (err error) {
|
||||
// this ensures they run regardless of how the function exits
|
||||
defer func() {
|
||||
s.Time.Duration = time.Since(s.Time.StartAt).Seconds()
|
||||
log.Info().Int("duration(s)", int(s.Time.Duration)).Msg("run testcase finished")
|
||||
exitCode := code.GetErrorCode(err)
|
||||
log.Info().Int("duration(s)", int(s.Time.Duration)).
|
||||
Int("exitCode", exitCode).Msg("run testcase finished")
|
||||
|
||||
// save summary
|
||||
if r.saveTests {
|
||||
|
||||
Reference in New Issue
Block a user