Skip to content

Commit

Permalink
refactor: rename to hrp
Browse files Browse the repository at this point in the history
  • Loading branch information
debugtalk committed Oct 16, 2021
1 parent ca8cda9 commit 296b343
Show file tree
Hide file tree
Showing 46 changed files with 273 additions and 270 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
name: httpboomer # User defined upload name. Visible in Codecov UI
name: hrp(HttpRunner+) # User defined upload name. Visible in Codecov UI
token: ${{ secrets.CODECOV_TOKEN }} # Repository upload token
file: ./cover.out # Path to coverage file to upload
flags: unittests # Flag upload to group coverage metrics
Expand Down
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# HttpBoomer
# HttpRunner+ (hrp)

[![Go Reference](https://pkg.go.dev/badge/github.com/httprunner/httpboomer.svg)](https://pkg.go.dev/github.com/httprunner/httpboomer)
[![Github Actions](https://github.com/httprunner/HttpBoomer/actions/workflows/main.yml/badge.svg)](https://github.com/httprunner/HttpBoomer/actions)
[![codecov](https://codecov.io/gh/httprunner/HttpBoomer/branch/main/graph/badge.svg?token=HPCQWCD7KO)](https://codecov.io/gh/httprunner/HttpBoomer)
[![Go Report Card](https://goreportcard.com/badge/github.com/httprunner/HttpBoomer)](https://goreportcard.com/report/github.com/httprunner/HttpBoomer)
[![FOSSA Status](https://app.fossa.com/api/projects/custom%2B27856%2Fgithub.com%2Fhttprunner%2FHttpBoomer.svg?type=shield)](https://app.fossa.com/reports/fb0e64a7-7dcf-48bb-8de9-8f0e016b903b)
[![Go Reference](https://pkg.go.dev/badge/github.com/httprunner/hrp.svg)](https://pkg.go.dev/github.com/httprunner/hrp)
[![Github Actions](https://github.com/httprunner/hrp/actions/workflows/main.yml/badge.svg)](https://github.com/httprunner/hrp/actions)
[![codecov](https://codecov.io/gh/httprunner/hrp/branch/main/graph/badge.svg?token=HPCQWCD7KO)](https://codecov.io/gh/httprunner/hrp)
[![Go Report Card](https://goreportcard.com/badge/github.com/httprunner/hrp)](https://goreportcard.com/report/github.com/httprunner/hrp)
[![FOSSA Status](https://app.fossa.com/api/projects/custom%2B27856%2Fgithub.com%2Fhttprunner%2Fhrp.svg?type=shield)](https://app.fossa.com/reports/fb0e64a7-7dcf-48bb-8de9-8f0e016b903b)

> HttpBoomer = [HttpRunner] + [Boomer]
> hrp (HttpRunnerPlus) = [HttpRunner] + [Boomer]
HttpBoomer is a golang implementation of [HttpRunner]. Ideally, HttpBoomer will be fully compatible with HttpRunner, including testcase format and usage. What's more, HttpBoomer will integrate Boomer natively to be a better load generator for [locust].
`hrp` is a golang implementation of [HttpRunner]. Ideally, `hrp` will be fully compatible with HttpRunner, including testcase format and usage. What's more, `hrp` will integrate Boomer natively to be a better load generator for [locust].

## Key Features

Expand All @@ -27,23 +27,23 @@ HttpBoomer is a golang implementation of [HttpRunner]. Ideally, HttpBoomer will
### Install

```bash
$ go get -u github.com/httprunner/httpboomer
$ go get -u github.com/httprunner/hrp
```

### Examples

This is an example of HttpBoomer testcase. You can find more in the [`examples`][examples] directory.
This is an example of `hrp` testcase. You can find more in the [`examples`][examples] directory.

```go
import (
"testing"

"github.com/httprunner/httpboomer"
"github.com/httprunner/hrp"
)

func TestCaseDemo(t *testing.T) {
testcase := &httpboomer.TestCase{
Config: httpboomer.TConfig{
testcase := &hrp.TestCase{
Config: hrp.TConfig{
Name: "demo with complex mechanisms",
BaseURL: "https://postman-echo.com",
Variables: map[string]interface{}{ // global level variables
Expand All @@ -54,16 +54,16 @@ func TestCaseDemo(t *testing.T) {
"varFoo2": "${max($a, $b)}", // 12.3; eval with built-in function
},
},
TestSteps: []httpboomer.IStep{
httpboomer.Step("get with params").
TestSteps: []hrp.IStep{
hrp.Step("get with params").
WithVariables(map[string]interface{}{ // step level variables
"n": 3, // inherit config level variables if not set in step level, a/varFoo1
"b": 34.5, // override config level variable if existed, n/b/varFoo2
"varFoo2": "${max($a, $b)}", // 34.5; override variable b and eval again
}).
GET("/get").
WithParams(map[string]interface{}{"foo1": "$varFoo1", "foo2": "$varFoo2"}). // request with params
WithHeaders(map[string]string{"User-Agent": "HttpBoomer"}). // request with headers
WithHeaders(map[string]string{"User-Agent": "HttpRunnerPlus"}). // request with headers
Extract().
WithJmesPath("body.args.foo1", "varFoo1"). // extract variable with jmespath
Validate().
Expand All @@ -72,7 +72,7 @@ func TestCaseDemo(t *testing.T) {
AssertLengthEqual("body.args.foo1", 5, "check args foo1"). // validate response body with jmespath
AssertLengthEqual("$varFoo1", 5, "check args foo1"). // assert with extracted variable from current step
AssertEqual("body.args.foo2", "34.5", "check args foo2"), // notice: request params value will be converted to string
httpboomer.Step("post json data").
hrp.Step("post json data").
POST("/post").
WithJSON(map[string]interface{}{
"foo1": "$varFoo1", // reference former extracted variable
Expand All @@ -85,7 +85,7 @@ func TestCaseDemo(t *testing.T) {
},
}

err := httpboomer.Run(t, testcase)
err := hrp.Run(t, testcase)
if err != nil {
t.Fatalf("run testcase error: %v", err)
}
Expand Down
2 changes: 1 addition & 1 deletion boomer.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package httpboomer
package hrp

import (
"time"
Expand Down
2 changes: 1 addition & 1 deletion boomer_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package httpboomer
package hrp

import (
"testing"
Expand Down
2 changes: 1 addition & 1 deletion convert.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package httpboomer
package hrp

import (
"bytes"
Expand Down
4 changes: 2 additions & 2 deletions convert_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package httpboomer
package hrp

import (
"os"
Expand Down Expand Up @@ -28,7 +28,7 @@ var demoTestCase = &TestCase{
}).
GET("/get").
WithParams(map[string]interface{}{"foo1": "$varFoo1", "foo2": "$varFoo2"}). // request with params
WithHeaders(map[string]string{"User-Agent": "HttpBoomer"}). // request with headers
WithHeaders(map[string]string{"User-Agent": "HttpRunnerPlus"}). // request with headers
Extract().
WithJmesPath("body.args.foo1", "varFoo1"). // extract variable with jmespath
Validate().
Expand Down
25 changes: 25 additions & 0 deletions docs/cmd/hrp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## hrp

One-stop solution for HTTP(S) testing.

### Synopsis

hrp(HttpRunnerPlus) is the next generation for HttpRunner. Enjoy! ✨ 🚀 ✨

License: Apache-2.0
Github: https://github.com/httprunner/hrp
Copyright 2021 debugtalk

### Options

```
-h, --help help for hrp
```

### SEE ALSO

* [hrp boom](hrp_boom.md) - run load test with boomer
* [hrp har2case](hrp_har2case.md) - Convert HAR to json/yaml testcase files
* [hrp run](hrp_run.md) - run API test

###### Auto generated by spf13/cobra on 16-Oct-2021
14 changes: 7 additions & 7 deletions docs/cmd/httpboomer_boom.md → docs/cmd/hrp_boom.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## httpboomer boom
## hrp boom

run load test with boomer

Expand All @@ -7,15 +7,15 @@ run load test with boomer
run yaml/json testcase files for load test

```
httpboomer boom [flags]
hrp boom [flags]
```

### Examples

```
$ httpboomer boom demo.json # run specified json testcase file
$ httpboomer boom demo.yaml # run specified yaml testcase file
$ httpboomer boom examples/ # run testcases in specified folder
$ hrp boom demo.json # run specified json testcase file
$ hrp boom demo.yaml # run specified yaml testcase file
$ hrp boom examples/ # run testcases in specified folder
```

### Options
Expand All @@ -35,6 +35,6 @@ httpboomer boom [flags]

### SEE ALSO

* [httpboomer](httpboomer.md) - One-stop solution for HTTP(S) testing.
* [hrp](hrp.md) - One-stop solution for HTTP(S) testing.

###### Auto generated by spf13/cobra on 11-Oct-2021
###### Auto generated by spf13/cobra on 16-Oct-2021
23 changes: 23 additions & 0 deletions docs/cmd/hrp_har2case.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## hrp har2case

Convert HAR to json/yaml testcase files

### Synopsis

Convert HAR to json/yaml testcase files

```
hrp har2case path... [flags]
```

### Options

```
-h, --help help for har2case
```

### SEE ALSO

* [hrp](hrp.md) - One-stop solution for HTTP(S) testing.

###### Auto generated by spf13/cobra on 16-Oct-2021
33 changes: 33 additions & 0 deletions docs/cmd/hrp_run.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
## hrp run

run API test

### Synopsis

run yaml/json testcase files for API test

```
hrp run path... [flags]
```

### Examples

```
$ hrp run demo.json # run specified json testcase file
$ hrp run demo.yaml # run specified yaml testcase file
$ hrp run examples/ # run testcases in specified folder
```

### Options

```
-h, --help help for run
-p, --proxy-url string set proxy url
-s, --silent disable logging request & response details
```

### SEE ALSO

* [hrp](hrp.md) - One-stop solution for HTTP(S) testing.

###### Auto generated by spf13/cobra on 16-Oct-2021
25 changes: 0 additions & 25 deletions docs/cmd/httpboomer.md

This file was deleted.

23 changes: 0 additions & 23 deletions docs/cmd/httpboomer_har2case.md

This file was deleted.

32 changes: 0 additions & 32 deletions docs/cmd/httpboomer_run.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/doc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/spf13/cobra/doc"

"github.com/httprunner/httpboomer/httpboomer/cmd"
"github.com/httprunner/hrp/hrp/cmd"
)

// run this test to generate markdown docs
Expand Down
2 changes: 1 addition & 1 deletion examples/demo.har
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
{
"name": "User-Agent",
"value": "HttpBoomer"
"value": "HttpRunnerPlus"
},
{
"name": "Accept-Encoding",
Expand Down
2 changes: 1 addition & 1 deletion examples/demo.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"foo2": "$varFoo2"
},
"headers": {
"User-Agent": "HttpBoomer"
"User-Agent": "HttpRunnerPlus"
}
},
"variables": {
Expand Down
2 changes: 1 addition & 1 deletion examples/demo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ teststeps:
foo1: $varFoo1
foo2: $varFoo2
headers:
User-Agent: HttpBoomer
User-Agent: HttpRunnerPlus
variables:
b: 34.5
"n": 3
Expand Down
Loading

0 comments on commit 296b343

Please sign in to comment.