change: upgrade funplugin to v0.4.0

This commit is contained in:
debugtalk
2022-03-20 10:12:17 +08:00
parent e34d6f9191
commit b367a68d9b
13 changed files with 28 additions and 19 deletions

View File

@@ -35,6 +35,7 @@ var scaffoldCmd = &cobra.Command{
log.Error().Err(err).Msg("create scaffold project failed")
os.Exit(1)
}
log.Info().Str("projectName", args[0]).Msg("create scaffold success")
return nil
},
}

View File

@@ -2,7 +2,7 @@
# install hrp with one shell command
# bash -c "$(curl -ksSL https://httprunner.oss-cn-beijing.aliyuncs.com/install.sh)"
LATEST_VERSION="v0.7.0"
LATEST_VERSION="v0.8.0-beta"
set -e

View File

@@ -1,8 +1,9 @@
# Release History
## v0.8.0 (2022-03-18)
## v0.8.0 (2022-03-21)
- feat: create scaffold with python plugin
- feat: support hashicorp python plugin over gRPC
- feat: create scaffold with plugin option, `--py`(default), `--go`, `--ignore-plugin`
- feat: print statistics summary after load testing finished
- fix: update prometheus state to stopped on quit
@@ -16,7 +17,7 @@
## v0.6.4 (2022-03-10)
- feat: both support gPRC(default) and net/rpc mode in hashicorp plugin, switch with environment `HRP_PLUGIN_TYPE`
- feat: both support gRPC(default) and net/rpc mode in hashicorp plugin, switch with environment `HRP_PLUGIN_TYPE`
- refactor: move submodule `plugin` to separate repo `github.com/httprunner/funplugin`
- refactor: replace builtin json library with `json-iterator/go` to improve performance

View File

@@ -33,4 +33,4 @@ Copyright 2021 debugtalk
* [hrp run](hrp_run.md) - run API test
* [hrp startproject](hrp_startproject.md) - create a scaffold project
###### Auto generated by spf13/cobra on 17-Mar-2022
###### Auto generated by spf13/cobra on 21-Mar-2022

View File

@@ -41,4 +41,4 @@ hrp boom [flags]
* [hrp](hrp.md) - One-stop solution for HTTP(S) testing.
###### Auto generated by spf13/cobra on 17-Mar-2022
###### Auto generated by spf13/cobra on 21-Mar-2022

View File

@@ -23,4 +23,4 @@ hrp har2case $har_path... [flags]
* [hrp](hrp.md) - One-stop solution for HTTP(S) testing.
###### Auto generated by spf13/cobra on 17-Mar-2022
###### Auto generated by spf13/cobra on 21-Mar-2022

View File

@@ -34,4 +34,4 @@ hrp run $path... [flags]
* [hrp](hrp.md) - One-stop solution for HTTP(S) testing.
###### Auto generated by spf13/cobra on 17-Mar-2022
###### Auto generated by spf13/cobra on 21-Mar-2022

View File

@@ -9,11 +9,14 @@ hrp startproject $project_name [flags]
### Options
```
-h, --help help for startproject
--go generate hashicorp go plugin
-h, --help help for startproject
--ignore-plugin ignore function plugin
--py generate hashicorp python plugin (default true)
```
### SEE ALSO
* [hrp](hrp.md) - One-stop solution for HTTP(S) testing.
###### Auto generated by spf13/cobra on 17-Mar-2022
###### Auto generated by spf13/cobra on 21-Mar-2022

2
go.mod
View File

@@ -6,7 +6,7 @@ require (
github.com/andybalholm/brotli v1.0.4
github.com/denisbrodbeck/machineid v1.0.1
github.com/google/uuid v1.3.0
github.com/httprunner/funplugin v0.3.2-0.20220319011341-76c4084b52ae
github.com/httprunner/funplugin v0.4.0
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

@@ -198,8 +198,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.3.2-0.20220319011341-76c4084b52ae h1:phue9WjORQnb5UM4a8Um2fl3pDNaSOUCAMo4TlgVTB4=
github.com/httprunner/funplugin v0.3.2-0.20220319011341-76c4084b52ae/go.mod h1:vPyeJIfbpGe0epZZtAV0wCn16gLY9+imSw/zfxq0Lcc=
github.com/httprunner/funplugin v0.4.0 h1:jSptZ6Ki0Dh3uvpLDbmxE6kSqVv0FHaQnHs0Qt+6SS8=
github.com/httprunner/funplugin v0.4.0/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/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM=

View File

@@ -15,12 +15,12 @@ import (
"github.com/httprunner/hrp/internal/ga"
)
type PluginType uint
type PluginType string
const (
Ignore PluginType = iota
Py
Go
Ignore PluginType = "ignore"
Py PluginType = "py"
Go PluginType = "go"
)
func CreateScaffold(projectName string, pluginType PluginType) error {
@@ -37,7 +37,10 @@ func CreateScaffold(projectName string, pluginType PluginType) error {
return fmt.Errorf("project name already exists")
}
log.Info().Str("projectName", projectName).Msg("create new scaffold project")
log.Info().
Str("projectName", projectName).
Str("pluginType", string(pluginType)).
Msg("create new scaffold project")
// create project folders
if err := builtin.CreateFolder(projectName); err != nil {

View File

@@ -1,3 +1,3 @@
package version
const VERSION = "v0.7.0"
const VERSION = "v0.8.0-beta"

View File

@@ -74,6 +74,7 @@ func assertRunTestCases(t *testing.T) {
testcase4 := &demoRefTestCaseJSONPath
r := NewRunner(t)
r.SetPluginLogOn()
err := r.Run(testcase1, testcase2, testcase3, testcase4)
if err != nil {
t.Fatalf("run testcase error: %v", err)