feat #1342: support specify custom python3 venv

This commit is contained in:
debugtalk
2022-06-13 14:02:36 +08:00
parent f24c453890
commit 182d2fd5d8
35 changed files with 381 additions and 123 deletions

View File

@@ -58,6 +58,7 @@ type HRPRunner struct {
httpStatOn bool
requestsLogOn bool
pluginLogOn bool
venv string
saveTests bool
genHTMLReport bool
httpClient *http.Client
@@ -116,6 +117,13 @@ func (r *HRPRunner) SetPluginLogOn() *HRPRunner {
return r
}
// SetPython3Venv specifies python3 venv.
func (r *HRPRunner) SetPython3Venv(venv string) *HRPRunner {
log.Info().Str("venv", venv).Msg("[init] SetPython3Venv")
r.venv = venv
return r
}
// SetProxyUrl configures the proxy URL, which is usually used to capture HTTP packets for debugging.
func (r *HRPRunner) SetProxyUrl(proxyUrl string) *HRPRunner {
log.Info().Str("proxyUrl", proxyUrl).Msg("[init] SetProxyUrl")
@@ -235,7 +243,7 @@ func (r *HRPRunner) newCaseRunner(testcase *TestCase) (*testCaseRunner, error) {
}
// init parser plugin
plugin, err := initPlugin(testcase.Config.Path, r.pluginLogOn)
plugin, err := initPlugin(testcase.Config.Path, r.venv, r.pluginLogOn)
if err != nil {
return nil, errors.Wrap(err, "init plugin failed")
}