change: create python3 plugin venv with latest funppy/httprunner

This commit is contained in:
lilong.129
2023-08-20 14:09:37 +08:00
parent b5c8a98ed2
commit c2935cf1a6
8 changed files with 13 additions and 31 deletions

View File

@@ -8,9 +8,10 @@ plugin related:
- feat: add hrp executable directory for searching plugin - feat: add hrp executable directory for searching plugin
- feat: init device driver with plugin option - feat: init device driver with plugin option
- change: upgrade funplugin to 0.5.2
- refactor: move internal myexec to funplugin/myexec
- feat: support printing stderr output in myexec.RunCommand - feat: support printing stderr output in myexec.RunCommand
- change: upgrade funplugin to 0.5.3
- refactor: move internal myexec to funplugin/myexec
- change: create python3 plugin venv with latest funppy/httprunner
UI related: UI related:

4
go.mod
View File

@@ -10,7 +10,7 @@ require (
github.com/go-openapi/spec v0.20.7 github.com/go-openapi/spec v0.20.7
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510 github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510
github.com/gorilla/websocket v1.5.0 github.com/gorilla/websocket v1.5.0
github.com/httprunner/funplugin v0.5.2 github.com/httprunner/funplugin v0.5.3-0.20230820060317-610ea1f2421e
github.com/jinzhu/copier v0.3.5 github.com/jinzhu/copier v0.3.5
github.com/jmespath/go-jmespath v0.4.0 github.com/jmespath/go-jmespath v0.4.0
github.com/json-iterator/go v1.1.12 github.com/json-iterator/go v1.1.12
@@ -76,7 +76,7 @@ require (
golang.org/x/sys v0.11.0 // indirect golang.org/x/sys v0.11.0 // indirect
golang.org/x/text v0.12.0 // indirect golang.org/x/text v0.12.0 // indirect
google.golang.org/appengine v1.6.7 // indirect google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230807174057-1744710a1577 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20230815205213-6bfd019c3878 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect
) )

8
go.sum
View File

@@ -171,8 +171,8 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE= github.com/hashicorp/yamux v0.1.1 h1:yrQxtgseBDrq9Y652vSRDvsKCJKOUD+GzTS4Y0Y8pvE=
github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ= github.com/hashicorp/yamux v0.1.1/go.mod h1:CtWFDAQgb7dxtzFs4tWbplKIe2jSi3+5vKbgIO0SLnQ=
github.com/httprunner/funplugin v0.5.2 h1:VgDkHXNEo55KRgNZz+1oW8JboSNpfufNOfPD7l0LGyI= github.com/httprunner/funplugin v0.5.3-0.20230820060317-610ea1f2421e h1:Y88PQsT2JOj5CUtYyH8RkUu+h+1SA5cr0bS3cyyKGso=
github.com/httprunner/funplugin v0.5.2/go.mod h1:YZzBBSOSdLZEpHZz0P2E5SOQ+o1+Fbn30oWS4RGHBz0= github.com/httprunner/funplugin v0.5.3-0.20230820060317-610ea1f2421e/go.mod h1:YZzBBSOSdLZEpHZz0P2E5SOQ+o1+Fbn30oWS4RGHBz0=
github.com/hybridgroup/mjpeg v0.0.0-20140228234708-4680f319790e/go.mod h1:eagM805MRKrioHYuU7iKLUyFPVKqVV6um5DAvCkUtXs= github.com/hybridgroup/mjpeg v0.0.0-20140228234708-4680f319790e/go.mod h1:eagM805MRKrioHYuU7iKLUyFPVKqVV6um5DAvCkUtXs=
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8=
@@ -579,8 +579,8 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc
google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto/googleapis/rpc v0.0.0-20230807174057-1744710a1577 h1:wukfNtZmZUurLN/atp2hiIeTKn7QJWIQdHzqmsOnAOk= google.golang.org/genproto/googleapis/rpc v0.0.0-20230815205213-6bfd019c3878 h1:lv6/DhyiFFGsmzxbsUUTOkN29II+zeWHxvT8Lpdxsv0=
google.golang.org/genproto/googleapis/rpc v0.0.0-20230807174057-1744710a1577/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= google.golang.org/genproto/googleapis/rpc v0.0.0-20230815205213-6bfd019c3878/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=

View File

@@ -1,7 +1,6 @@
package cmd package cmd
import ( import (
"fmt"
"io/ioutil" "io/ioutil"
"path/filepath" "path/filepath"
@@ -12,7 +11,6 @@ import (
"github.com/httprunner/httprunner/v4/hrp/internal/builtin" "github.com/httprunner/httprunner/v4/hrp/internal/builtin"
"github.com/httprunner/httprunner/v4/hrp/internal/code" "github.com/httprunner/httprunner/v4/hrp/internal/code"
"github.com/httprunner/httprunner/v4/hrp/internal/version"
"github.com/httprunner/httprunner/v4/hrp/pkg/convert" "github.com/httprunner/httprunner/v4/hrp/pkg/convert"
) )
@@ -42,9 +40,7 @@ var convertCmd = &cobra.Command{
if toYAMLFlag { if toYAMLFlag {
outputType = convert.OutputTypeYAML outputType = convert.OutputTypeYAML
} else if toPyTestFlag { } else if toPyTestFlag {
packages := []string{ packages := []string{"httprunner"}
fmt.Sprintf("httprunner==%s", version.HttpRunnerMinimumVersion),
}
_, err := myexec.EnsurePython3Venv(venv, packages...) _, err := myexec.EnsurePython3Venv(venv, packages...)
if err != nil { if err != nil {
log.Error().Err(err).Msg("python3 venv is not ready") log.Error().Err(err).Msg("python3 venv is not ready")

View File

@@ -1,7 +1,6 @@
package cmd package cmd
import ( import (
"fmt"
"strings" "strings"
"time" "time"
@@ -13,7 +12,6 @@ import (
"github.com/httprunner/httprunner/v4/hrp/internal/code" "github.com/httprunner/httprunner/v4/hrp/internal/code"
"github.com/httprunner/httprunner/v4/hrp/internal/pytest" "github.com/httprunner/httprunner/v4/hrp/internal/pytest"
"github.com/httprunner/httprunner/v4/hrp/internal/sdk" "github.com/httprunner/httprunner/v4/hrp/internal/sdk"
"github.com/httprunner/httprunner/v4/hrp/internal/version"
) )
var pytestCmd = &cobra.Command{ var pytestCmd = &cobra.Command{
@@ -31,9 +29,7 @@ var pytestCmd = &cobra.Command{
}) })
}() }()
packages := []string{ packages := []string{"httprunner"}
fmt.Sprintf("httprunner==%s", version.HttpRunnerMinimumVersion),
}
_, err = myexec.EnsurePython3Venv(venv, packages...) _, err = myexec.EnsurePython3Venv(venv, packages...)
if err != nil { if err != nil {
log.Error().Err(err).Msg("python3 venv is not ready") log.Error().Err(err).Msg("python3 venv is not ready")

View File

@@ -7,7 +7,6 @@ import (
"path/filepath" "path/filepath"
"time" "time"
"github.com/httprunner/funplugin/fungo"
"github.com/httprunner/funplugin/myexec" "github.com/httprunner/funplugin/myexec"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/rs/zerolog/log" "github.com/rs/zerolog/log"
@@ -211,10 +210,7 @@ func createPythonPlugin(projectName, venv string) error {
return errors.Wrap(err, "copy file failed") return errors.Wrap(err, "copy file failed")
} }
packages := []string{ packages := []string{"funppy", "httprunner"}
fmt.Sprintf("funppy==%s", fungo.Version),
fmt.Sprintf("httprunner==%s", version.HttpRunnerMinimumVersion),
}
_, err = myexec.EnsurePython3Venv(venv, packages...) _, err = myexec.EnsurePython3Venv(venv, packages...)
if err != nil { if err != nil {
return errors.Wrap(code.InvalidPython3Venv, err.Error()) return errors.Wrap(code.InvalidPython3Venv, err.Error())

View File

@@ -6,6 +6,3 @@ import (
//go:embed VERSION //go:embed VERSION
var VERSION string var VERSION string
// httprunner python version
const HttpRunnerMinimumVersion = "v4.3.5"

View File

@@ -1,14 +1,12 @@
package hrp package hrp
import ( import (
"fmt"
"os" "os"
"path/filepath" "path/filepath"
"strings" "strings"
"sync" "sync"
"github.com/httprunner/funplugin" "github.com/httprunner/funplugin"
"github.com/httprunner/funplugin/fungo"
"github.com/httprunner/funplugin/myexec" "github.com/httprunner/funplugin/myexec"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/rs/zerolog/log" "github.com/rs/zerolog/log"
@@ -65,9 +63,7 @@ func initPlugin(path, venv string, logOn bool) (plugin funplugin.IPlugin, err er
} }
pluginPath = genPyPluginPath pluginPath = genPyPluginPath
packages := []string{ packages := []string{"funppy"}
fmt.Sprintf("funppy==%s", fungo.Version),
}
python3, err := myexec.EnsurePython3Venv(venv, packages...) python3, err := myexec.EnsurePython3Venv(venv, packages...)
if err != nil { if err != nil {
log.Error().Err(err). log.Error().Err(err).