mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 23:51:25 +08:00
fix: init plugin
This commit is contained in:
@@ -1 +1 @@
|
|||||||
v5.0.0+2503051811
|
v5.0.0-beta-2503051939
|
||||||
|
|||||||
@@ -37,12 +37,12 @@ func initPlugin(path, venv string, logOn bool) (plugin funplugin.IPlugin, err er
|
|||||||
Bool("logOn", logOn).Msg("init plugin")
|
Bool("logOn", logOn).Msg("init plugin")
|
||||||
// plugin file not found
|
// plugin file not found
|
||||||
if path == "" {
|
if path == "" {
|
||||||
return nil, nil
|
return nil, errors.New("testcase path not specified")
|
||||||
}
|
}
|
||||||
pluginPath, err := LocatePlugin(path)
|
pluginPath, err := LocatePlugin(path)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Warn().Str("path", path).Msg("locate plugin failed")
|
log.Warn().Str("path", path).Msg("locate plugin failed")
|
||||||
return nil, nil
|
return nil, errors.Wrap(err, "locate plugin failed")
|
||||||
}
|
}
|
||||||
|
|
||||||
pluginMutex.Lock()
|
pluginMutex.Lock()
|
||||||
|
|||||||
@@ -63,7 +63,8 @@ func assertRunTestCases(t *testing.T) {
|
|||||||
refCase := hrp.TestCasePath(demoTestCaseWithPluginJSONPath)
|
refCase := hrp.TestCasePath(demoTestCaseWithPluginJSONPath)
|
||||||
testcase1 := &hrp.TestCase{
|
testcase1 := &hrp.TestCase{
|
||||||
Config: hrp.NewConfig("TestCase1").
|
Config: hrp.NewConfig("TestCase1").
|
||||||
SetBaseURL("https://postman-echo.com"),
|
SetBaseURL("https://postman-echo.com").
|
||||||
|
EnablePlugin(), // TODO: FIXME
|
||||||
TestSteps: []hrp.IStep{
|
TestSteps: []hrp.IStep{
|
||||||
hrp.NewStep("testcase1-step1").
|
hrp.NewStep("testcase1-step1").
|
||||||
GET("/headers").
|
GET("/headers").
|
||||||
@@ -219,6 +220,7 @@ func TestRunCaseWithPluginJSON(t *testing.T) {
|
|||||||
defer removeHashicorpGoPlugin()
|
defer removeHashicorpGoPlugin()
|
||||||
|
|
||||||
testCase := hrp.TestCasePath(demoTestCaseWithPluginJSONPath)
|
testCase := hrp.TestCasePath(demoTestCaseWithPluginJSONPath)
|
||||||
|
// TODO: FIXME, enable plugin
|
||||||
err := hrp.NewRunner(nil).Run(&testCase) // hrp.Run(testCase)
|
err := hrp.NewRunner(nil).Run(&testCase) // hrp.Run(testCase)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal()
|
t.Fatal()
|
||||||
|
|||||||
Reference in New Issue
Block a user