mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-09 06:23:52 +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.
|
// Run starts to run testcase with default configs.
|
||||||
func Run(t *testing.T, testcases ...ITestCase) error {
|
func Run(t *testing.T, testcases ...ITestCase) error {
|
||||||
err := NewRunner(t).SetSaveTests(true).Run(testcases...)
|
return NewRunner(t).SetSaveTests(true).Run(testcases...)
|
||||||
code.GetErrorCode(err)
|
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewRunner constructs a new runner instance.
|
// 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
|
// this ensures they run regardless of how the function exits
|
||||||
defer func() {
|
defer func() {
|
||||||
s.Time.Duration = time.Since(s.Time.StartAt).Seconds()
|
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
|
// save summary
|
||||||
if r.saveTests {
|
if r.saveTests {
|
||||||
|
|||||||
Reference in New Issue
Block a user