From a0c1315399d489d69bdfae25b3dc9ffec84be530 Mon Sep 17 00:00:00 2001 From: "lilong.129" Date: Tue, 1 Jul 2025 14:47:48 +0800 Subject: [PATCH] change: print exit code --- internal/version/VERSION | 2 +- runner.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/version/VERSION b/internal/version/VERSION index 524b9a16..9066599a 100644 --- a/internal/version/VERSION +++ b/internal/version/VERSION @@ -1 +1 @@ -v5.0.0-250630 +v5.0.0-250701 diff --git a/runner.go b/runner.go index 81bb88fe..083218d5 100644 --- a/runner.go +++ b/runner.go @@ -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 {