fix: plugin file distribution

This commit is contained in:
xucong053
2022-07-06 13:22:18 +08:00
committed by 徐聪
parent caed68d6dd
commit b325232a6c
4 changed files with 11 additions and 9 deletions

View File

@@ -281,14 +281,17 @@ func (r *HRPRunner) newCaseRunner(testcase *TestCase) (*testCaseRunner, error) {
timeout := time.Duration(runner.testCase.Config.Timeout*1000) * time.Millisecond
runner.hrpRunner.SetTimeout(timeout)
}
// load plugin info to testcase config
if plugin != nil {
pluginContent, err := builtin.ReadFile(plugin.Path())
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: plugin.Path(),
Path: pluginPath,
Content: pluginContent,
Type: tp[len(tp)-1],
}