mirror of
https://github.com/httprunner/httprunner.git
synced 2026-07-07 23:41:22 +08:00
Merge branch 'master' into ios-wda
This commit is contained in:
@@ -17,6 +17,7 @@ import (
|
||||
"github.com/rs/zerolog/log"
|
||||
"golang.org/x/net/http2"
|
||||
|
||||
"github.com/httprunner/funplugin"
|
||||
"github.com/httprunner/httprunner/v4/hrp/internal/builtin"
|
||||
"github.com/httprunner/httprunner/v4/hrp/internal/sdk"
|
||||
)
|
||||
@@ -190,11 +191,12 @@ func (r *HRPRunner) Run(testcases ...ITestCase) error {
|
||||
|
||||
// quit all plugins
|
||||
defer func() {
|
||||
if len(pluginMap) > 0 {
|
||||
for _, plugin := range pluginMap {
|
||||
pluginMap.Range(func(key, value interface{}) bool {
|
||||
if plugin, ok := value.(funplugin.IPlugin); ok {
|
||||
plugin.Quit()
|
||||
}
|
||||
}
|
||||
return true
|
||||
})
|
||||
}()
|
||||
|
||||
var runErr error
|
||||
@@ -287,15 +289,17 @@ func (r *HRPRunner) newCaseRunner(testcase *TestCase) (*testCaseRunner, error) {
|
||||
// load plugin info to testcase config
|
||||
if plugin != nil {
|
||||
pluginPath, _ := locatePlugin(testcase.Config.Path)
|
||||
pluginContent, err := builtin.ReadFile(pluginPath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
tp := strings.Split(plugin.Path(), ".")
|
||||
runner.parsedConfig.PluginSetting = &PluginConfig{
|
||||
Path: pluginPath,
|
||||
Content: pluginContent,
|
||||
Type: tp[len(tp)-1],
|
||||
if runner.parsedConfig.PluginSetting == nil {
|
||||
pluginContent, err := builtin.ReadFile(pluginPath)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
tp := strings.Split(plugin.Path(), ".")
|
||||
runner.parsedConfig.PluginSetting = &PluginConfig{
|
||||
Path: pluginPath,
|
||||
Content: pluginContent,
|
||||
Type: tp[len(tp)-1],
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user