fix: testcase compatibility in the worker

This commit is contained in:
徐聪
2022-07-29 19:57:05 +08:00
parent 88c25d26c4
commit b9f1468ae2
3 changed files with 27 additions and 24 deletions

View File

@@ -285,15 +285,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],
}
}
}