mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-07 00:17:37 +08:00
feat: add hrp.Run wrapper
This commit is contained in:
+5
-9
@@ -30,10 +30,11 @@ import (
|
||||
"github.com/httprunner/httprunner/v4/hrp/pkg/uixt"
|
||||
)
|
||||
|
||||
// Run starts to run API test with default configs.
|
||||
func Run(testcases ...ITestCase) error {
|
||||
t := &testing.T{}
|
||||
return NewRunner(t).SetRequestsLogOn().Run(testcases...)
|
||||
// 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
|
||||
}
|
||||
|
||||
// NewRunner constructs a new runner instance.
|
||||
@@ -204,11 +205,6 @@ func (r *HRPRunner) Run(testcases ...ITestCase) (err error) {
|
||||
// record execution data to summary
|
||||
s := newOutSummary()
|
||||
|
||||
defer func() {
|
||||
exitCode := code.GetErrorCode(err)
|
||||
log.Info().Int("code", exitCode).Msg("hrp runner exit code")
|
||||
}()
|
||||
|
||||
// load all testcases
|
||||
testCases, err := LoadTestCases(testcases...)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user