move files to hrp

This commit is contained in:
debugtalk
2022-03-23 15:10:23 +08:00
parent f8113ea364
commit 8268aa0822
125 changed files with 0 additions and 0 deletions

View File

@@ -1,53 +0,0 @@
# Builtin
## Builtin assertions
HttpRunner+ validation should follow the following format. `check`, `assert` and `expect` are required field.
```json
{
"check": "status_code", // target field, usually used with jmespath
"assert": "equals", // assertion method, you can use builtin method or custom defined function
"expect": 200, // expected value
"msg": "check response status code" // optional, print this message if assertion failed
}
```
The `assert` method name will be mapped to a built-in function with the following function signature.
```go
func(t assert.TestingT, actual interface{}, expected interface{}, msgAndArgs ...interface{}) bool
```
Currently, HttpRunner+ has the following built-in assertion functions.
| `assert` | Description | A(check), B(expect) | examples |
| --- | --- | --- | --- |
| `eq`, `equals`, `equal` | value is equal | A == B | 9 eq 9 |
| `lt`, `less_than` | less than | A < B | 7 lt 8 |
| `le`, `less_or_equals` | less than or equals | A <= B | 7 le 8, 8 le 8 |
| `gt`, `greater_than` | greater than | A > B | 8 gt 7 |
| `ge`, `greater_or_equals` | greater than or equals | A >= B | 8 ge 7, 8 ge 8 |
| `ne`, `not_equal` | not equals | A != B | 6 ne 9 |
| `str_eq`, `string_equals` | string equals | str(A) == str(B) | 123 str_eq '123' |
| `len_eq`, `length_equals`, `length_equal` | length equals | len(A) == B | 'abc' len_eq 3, [1,2] len_eq 2 |
| `len_gt`, `count_gt`, `length_greater_than` | length greater than | len(A) > B | 'abc' len_gt 2, [1,2,3] len_gt 2 |
| `len_ge`, `count_ge`, `length_greater_or_equals` | length greater than or equals | len(A) >= B | 'abc' len_ge 3, [1,2,3] len_gt 3 |
| `len_lt`, `count_lt`, `length_less_than` | length less than | len(A) < B | 'abc' len_lt 4, [1,2,3] len_lt 4 |
| `len_le`, `count_le`, `length_less_or_equals` | length less than or equals | len(A) <= B | 'abc' len_le 3, [1,2,3] len_le 3 |
| `contains` | contains | [1, 2] contains 1 | 'abc' contains 'a', [1,2,3] len_lt 4 |
| `contained_by` | contained by | A in B | 'a' contained_by 'abc', 1 contained_by [1,2] |
| `type_match` | A and B are in the same type | type(A) == type(B) | 123 type_match 1 |
| `regex_match` | regex matches | re.match(B, A) | 'abcdef' regex_match 'a\w+d' |
| `startswith` | starts with | A.startswith(B) is True | 'abc' startswith 'ab' |
| `endswith` | ends with | A.endswith(B) is True | 'abc' endswith 'bc' |
## Builtin functions
| Name | Arguments | Description |
| --- | --- | --- |
| `get_timestamp` | () | get the thirteen-digit timestamp of current time. |
| `sleep` | (n int) | sleep n seconds to simulate the thinking time. |
| `gen_random_string` | (n int) | get the n-digit random string. |
| `max` | (m,n int) | get the maximum of two numbers m and n. |
| `md5` | (s string) | get the MD5 of the input string s. |

View File

@@ -1,142 +0,0 @@
# Release History
## v0.8.0 (2022-03-22)
- 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
- feat: support think time for api/load testing
- fix: update prometheus state to stopped on quit
## v0.7.0 (2022-03-15)
- feat: support API layer for testcase #94
- feat: support global headers for testcase #95
- feat: support call referenced testcase by path in YAML/JSON testcases
- fix: decode failure when content-encoding is deflate
- fix: unstable RPS when load testing in high concurrency
## v0.6.4 (2022-03-10)
- 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
## v0.6.3 (2022-03-04)
- feat: support customized setup/teardown hooks (variable assignment not supported)
- feat: add flag `--log-plugin` to turn on plugin logging
- change: add short flag `-c` for `--continue-on-failure`
- change: use `--log-requests-off` flag to turn off request & response details logging
- fix: support posting body in json array format
- fix: testcase format compatibility with HttpRunner
## v0.6.2 (2022-02-22)
- feat: support text/html extraction with regex
- change: json unmarshal to json.Number when parsing data
- fix: omit pseudo header names for HTTP/1, e.g. :authority
- fix: generate `headers.\"Content-Type\"` in har2case
- fix: incorrect data type when extracting data using jmespath
- fix: decode response body in brotli/gzip/deflate formats
- fix: omit print request/response body for non-text content
- fix: parse data for request cookie value
## v0.6.1 (2022-02-17)
- change: json unmarshal to float64 when parsing data
- fix: set request Content-Type for posting json only when not specified
- fix: failed to generate API test report when data is null
- fix: panic when assertion function not exists
- fix: broadcast to all rendezvous at once when spawn done
## v0.6.0 (2022-02-08)
- feat: implement `rendezvous` mechanism for data driven
- feat: upload release artifacts to aliyun oss
- feat: dump tests summary for execution results
- feat: generate html report for API testing
- change: remove sentry sdk
## v0.5.3 (2022-01-25)
- change: download package assets from aliyun OSS
- fix: disable color logging on Windows
- fix: print stderr when exec command failed
- fix: build hashicorp plugin failed when creating scaffold
## v0.5.2 (2022-01-19)
- feat: support creating and calling custom functions with [hashicorp/go-plugin](https://github.com/hashicorp/go-plugin)
- feat: add scaffold demo with hashicorp plugin
- feat: report events for initializing plugin
- fix: log failures when the assertion failed
## v0.5.1 (2022-01-13)
- feat: support specifying running cycles for load testing
- fix: ensure last stats reported when stop running
## v0.5.0 (2022-01-08)
- feat: support creating and calling custom functions with [go plugin](https://pkg.go.dev/plugin)
- feat: install hrp with one shell command
- feat: add `startproject` sub-command for creating scaffold project
- feat: report GA event for loading go plugin
## v0.4.0 (2022-01-05)
- feat: implement `parameterize` mechanism for data driven
- feat: add multiple builtin assertion methods and builtin functions
## v0.3.1 (2021-12-30)
- fix: set ulimit to 10240 before load testing
- fix: concurrent map writes in load testing
## v0.3.0 (2021-12-24)
- feat: implement `transaction` mechanism for load test
- feat: continue running next step when failure occurs with `--continue-on-failure` flag, default to failfast
- feat: report GA events with version
- feat: run load test with the given limit and burst as rate limiter, use `--spawn-count`, `--spawn-rate` and `--request-increase-rate` flag
- feat: report runner state to prometheus
- refactor: fork [boomer] as submodule initially and made a lot of changes
- change: update API models
## v0.2.2 (2021-12-07)
- refactor: update models to make API more concise
- change: remove mkdocs, move to [repo](https://github.com/httprunner/httprunner.github.io)
## v0.2.1 (2021-12-02)
- feat: push load testing metrics to [Prometheus Pushgateway][pushgateway]
- feat: report events with Google Analytics
## v0.2.0 (2021-11-19)
- feat: deploy mkdocs to github pages when PR merged
- feat: release hrp cli binaries automatically with github actions
- feat: add Makefile for running unittest and building hrp cli binary
## v0.1.0 (2021-11-18)
- feat: full support for HTTP(S)/1.1 methods
- feat: integrate [zerolog](https://github.com/rs/zerolog) for logging, include json log and pretty color console log
- feat: implement `har2case` for converting HAR to JSON/YAML testcases
- feat: extract and validate json response with [`jmespath`][jmespath]
- feat: run JSON/YAML testcases with builtin functions
- feat: support testcase and teststep level variables mechanism
- feat: integrate [`boomer`][boomer] standalone mode for load testing
- docs: init documentation website with [`mkdocs`][mkdocs]
- docs: add project badges, including go report card, codecov, github actions, FOSSA, etc.
- test: add CI test with [github actions][github-actions]
- test: integrate [sentry sdk][sentry sdk] for event reporting and analysis
[jmespath]: https://jmespath.org/
[mkdocs]: https://www.mkdocs.org/
[github-actions]: https://github.com/httprunner/hrp/actions
[boomer]: github.com/myzhan/boomer
[sentry sdk]: https://github.com/getsentry/sentry-go
[pushgateway]: https://github.com/prometheus/pushgateway

View File

@@ -1,9 +0,0 @@
# Links
- Homepage: https://httprunner.com
- Docs
- Repo: https://github.com/httprunner/httprunner.github.io
- 中文: https://httprunner.com/docs
- English: https://httprunner.com/en/docs
- [hrp command help](cmd/hrp.md)
- Blog: https://httprunner.com/blog

Binary file not shown.

Before

Width:  |  Height:  |  Size: 214 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

View File

@@ -1 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 717.11 249.68"><title>sentry-logo-black</title><path d="M430.56,143.76,386.07,86.33H375v77h11.22v-59l45.74,59h9.82v-77H430.56Zm-112-14.27H358.4v-10H318.52V96.31h45v-10H307.07v77h57v-10H318.52Zm-46.84-9.78c-15.57-3.72-19.83-6.69-19.83-13.84,0-6.46,5.71-10.81,14.22-10.81,7.09,0,14.07,2.51,21.3,7.67l6.06-8.54c-8-6.13-16.65-9-27.13-9-15.25,0-25.89,9-25.89,21.92,0,13.84,9,18.63,25.5,22.63,14.51,3.35,18.93,6.5,18.93,13.5s-6,11.38-15.35,11.38c-9.07,0-16.81-3-25-9.82l-6.79,8.08a47.82,47.82,0,0,0,31.41,11.6c16.49,0,27.14-8.87,27.14-22.6C296.27,130.23,289.38,124,271.68,119.71Zm373.9-33.37-23.19,36.31-23-36.31H586l30.51,46.54v30.47h11.56V132.53l30.5-46.19ZM450.87,96.76H476.1v66.58h11.57V96.76h25.23V86.33h-62ZM566.4,133.28c11.64-3.21,18-11.37,18-23,0-14.78-10.84-24-28.28-24H522v77h11.45V135.62h19.42l19.54,27.72h13.37l-21.1-29.58Zm-33-7.52V96.53H555c11.27,0,17.74,5.31,17.74,14.56,0,8.91-6.92,14.67-17.62,14.67ZM144.9,65.43a13.75,13.75,0,0,0-23.81,0l-19.6,33.95,5,2.87a96.14,96.14,0,0,1,47.83,77.4H140.56a82.4,82.4,0,0,0-41-65.54l-5-2.86L76.3,143l5,2.87a46.35,46.35,0,0,1,22.46,33.78H72.33a2.27,2.27,0,0,1-2-3.41l8.76-15.17a31.87,31.87,0,0,0-10-5.71L60.42,170.5a13.75,13.75,0,0,0,11.91,20.62h43.25v-5.73A57.16,57.16,0,0,0,91.84,139l6.88-11.92a70.93,70.93,0,0,1,30.56,58.26v5.74h36.65v-5.73A107.62,107.62,0,0,0,117.09,95.3L131,71.17a2.27,2.27,0,0,1,3.93,0l60.66,105.07a2.27,2.27,0,0,1-2,3.41H179.4c.18,3.83.2,7.66,0,11.48h14.24a13.75,13.75,0,0,0,11.91-20.62Z" style="fill:#221f20"/></svg>

Before

Width:  |  Height:  |  Size: 1.5 KiB

View File

@@ -1,36 +0,0 @@
## hrp
One-stop solution for HTTP(S) testing.
### Synopsis
██╗ ██╗████████╗████████╗██████╗ ██████╗ ██╗ ██╗███╗ ██╗███╗ ██╗███████╗██████╗
██║ ██║╚══██╔══╝╚══██╔══╝██╔══██╗██╔══██╗██║ ██║████╗ ██║████╗ ██║██╔════╝██╔══██╗
███████║ ██║ ██║ ██████╔╝██████╔╝██║ ██║██╔██╗ ██║██╔██╗ ██║█████╗ ██████╔╝
██╔══██║ ██║ ██║ ██╔═══╝ ██╔══██╗██║ ██║██║╚██╗██║██║╚██╗██║██╔══╝ ██╔══██╗
██║ ██║ ██║ ██║ ██║ ██║ ██║╚██████╔╝██║ ╚████║██║ ╚████║███████╗██║ ██║
╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚═══╝╚══════╝╚═╝ ╚═╝
hrp (HttpRunner+) aims to be a one-stop solution for HTTP(S) testing, covering API testing,
load testing and digital experience monitoring (DEM). Enjoy! ✨ 🚀 ✨
License: Apache-2.0
Website: https://httprunner.com
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
* [hrp startproject](hrp_startproject.md) - create a scaffold project
###### Auto generated by spf13/cobra on 22-Mar-2022

View File

@@ -1,44 +0,0 @@
## hrp boom
run load test with boomer
### Synopsis
run yaml/json testcase files for load test
```
hrp boom [flags]
```
### Examples
```
$ 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
```
--cpu-profile string Enable CPU profiling.
--cpu-profile-duration duration CPU profile duration. (default 30s)
--disable-compression Disable compression
--disable-console-output Disable console output.
--disable-keepalive Disable keepalive
-h, --help help for boom
--loop-count int The specify running cycles for load testing (default -1)
--max-rps int Max RPS that boomer can generate, disabled by default.
--mem-profile string Enable memory profiling.
--mem-profile-duration duration Memory profile duration. (default 30s)
--prometheus-gateway string Prometheus Pushgateway url.
--request-increase-rate string Request increase rate, disabled by default. (default "-1")
--spawn-count int The number of users to spawn for load testing (default 1)
--spawn-rate float The rate for spawning users (default 1)
```
### SEE ALSO
* [hrp](hrp.md) - One-stop solution for HTTP(S) testing.
###### Auto generated by spf13/cobra on 22-Mar-2022

View File

@@ -1,26 +0,0 @@
## hrp har2case
convert HAR to json/yaml testcase files
### Synopsis
convert HAR to json/yaml testcase files
```
hrp har2case $har_path... [flags]
```
### Options
```
-h, --help help for har2case
-d, --output-dir string specify output directory, default to the same dir with har file
-j, --to-json convert to JSON format (default true)
-y, --to-yaml convert to YAML format
```
### SEE ALSO
* [hrp](hrp.md) - One-stop solution for HTTP(S) testing.
###### Auto generated by spf13/cobra on 22-Mar-2022

View File

@@ -1,37 +0,0 @@
## 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
```
-c, --continue-on-failure continue running next step when failure occurs
-g, --gen-html-report generate html report
-h, --help help for run
--log-plugin turn on plugin logging
--log-requests-off turn off request & response details logging
-p, --proxy-url string set proxy url
-s, --save-tests save tests summary
```
### SEE ALSO
* [hrp](hrp.md) - One-stop solution for HTTP(S) testing.
###### Auto generated by spf13/cobra on 22-Mar-2022

View File

@@ -1,22 +0,0 @@
## hrp startproject
create a scaffold project
```
hrp startproject $project_name [flags]
```
### Options
```
--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 22-Mar-2022