change: hrp install httprunner v4

This commit is contained in:
debugtalk
2022-04-25 18:36:24 +08:00
parent c438c955fb
commit 1a0c383a19
7 changed files with 15 additions and 7 deletions

2
go.mod
View File

@@ -8,7 +8,7 @@ require (
github.com/getsentry/sentry-go v0.13.0
github.com/google/uuid v1.3.0
github.com/gorilla/websocket v1.4.1
github.com/httprunner/funplugin v0.4.3
github.com/httprunner/funplugin v0.4.4
github.com/jinzhu/copier v0.3.2
github.com/jmespath/go-jmespath v0.4.0
github.com/json-iterator/go v1.1.12

4
go.sum
View File

@@ -241,8 +241,8 @@ github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2p
github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc=
github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb h1:b5rjCoWHc7eqmAS4/qyk21ZsHyb6Mxv/jykxvNTkU4M=
github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM=
github.com/httprunner/funplugin v0.4.3 h1:mxdxQh54NZLQnK/FXZxpZV0rhqZQzckrWKEnBW5w2Vg=
github.com/httprunner/funplugin v0.4.3/go.mod h1:vPyeJIfbpGe0epZZtAV0wCn16gLY9+imSw/zfxq0Lcc=
github.com/httprunner/funplugin v0.4.4 h1:IVt603Y57WfSbn6DZ0R4iLeGQJ1yj944gmYwEOSBzGo=
github.com/httprunner/funplugin v0.4.4/go.mod h1:vPyeJIfbpGe0epZZtAV0wCn16gLY9+imSw/zfxq0Lcc=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/imkira/go-interpol v1.1.0/go.mod h1:z0h2/2T3XF8kyEPpRgJ3kmNv+C43p+I/CoI+jC3w2iA=

View File

@@ -86,7 +86,7 @@ func EnsurePython3Venv(packages ...string) (string, error) {
venvDir := filepath.Join(home, ".hrp", "venv")
python3, err := shared.EnsurePython3Venv(venvDir, packages...)
if err != nil {
return "", errors.Wrap(err, "ensure python venv failed")
return "", errors.Wrap(err, "ensure python3 venv failed")
}
return python3, nil

View File

@@ -10,6 +10,7 @@ import (
"github.com/httprunner/httprunner/hrp"
"github.com/httprunner/httprunner/hrp/internal/builtin"
"github.com/httprunner/httprunner/hrp/internal/sdk"
"github.com/httprunner/httprunner/hrp/internal/version"
)
func Convert2TestScripts(destType string, paths ...string) error {
@@ -28,7 +29,8 @@ func Convert2TestScripts(destType string, paths ...string) error {
}
func convert2PyTestScripts(paths ...string) error {
python3, err := builtin.EnsurePython3Venv("httprunner")
httprunner := fmt.Sprintf("httprunner>=%s", version.HttpRunnerMinVersion)
python3, err := builtin.EnsurePython3Venv(httprunner)
if err != nil {
return err
}

View File

@@ -1,8 +1,11 @@
package pytest
import (
"fmt"
"github.com/httprunner/httprunner/hrp/internal/builtin"
"github.com/httprunner/httprunner/hrp/internal/sdk"
"github.com/httprunner/httprunner/hrp/internal/version"
)
func RunPytest(args []string) error {
@@ -11,7 +14,8 @@ func RunPytest(args []string) error {
Action: "hrp pytest",
})
python3, err := builtin.EnsurePython3Venv("httprunner")
httprunner := fmt.Sprintf("httprunner>=%s", version.HttpRunnerMinVersion)
python3, err := builtin.EnsurePython3Venv(httprunner)
if err != nil {
return err
}

View File

@@ -185,7 +185,7 @@ func createPythonPlugin(projectName string) error {
return errors.Wrap(err, "copy file failed")
}
_, err = builtin.EnsurePython3Venv(fmt.Sprintf("funppy==%s", shared.Version))
_, err = builtin.EnsurePython3Venv(fmt.Sprintf("funppy>=%s", shared.Version))
if err != nil {
return err
}

View File

@@ -6,3 +6,5 @@ import (
//go:embed VERSION
var VERSION string
const HttpRunnerMinVersion = "v4.0.0-beta"