mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-05 15:37:35 +08:00
update subcommand curl docs
This commit is contained in:
+1
-1
@@ -37,4 +37,4 @@ Copyright 2017 debugtalk
|
|||||||
* [hrp startproject](hrp_startproject.md) - create a scaffold project
|
* [hrp startproject](hrp_startproject.md) - create a scaffold project
|
||||||
* [hrp wiki](hrp_wiki.md) - visit https://httprunner.com
|
* [hrp wiki](hrp_wiki.md) - visit https://httprunner.com
|
||||||
|
|
||||||
###### Auto generated by spf13/cobra on 4-Jul-2022
|
###### Auto generated by spf13/cobra on 6-Jul-2022
|
||||||
|
|||||||
@@ -41,5 +41,6 @@ hrp boom [flags]
|
|||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [hrp](hrp.md) - Next-Generation API Testing Solution.
|
* [hrp](hrp.md) - Next-Generation API Testing Solution.
|
||||||
|
* [hrp boom curl](hrp_boom_curl.md) - run load test with boomer using converted curl testcase
|
||||||
|
|
||||||
###### Auto generated by spf13/cobra on 4-Jul-2022
|
###### Auto generated by spf13/cobra on 6-Jul-2022
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
## hrp boom curl
|
||||||
|
|
||||||
|
run load test with boomer using converted curl testcase
|
||||||
|
|
||||||
|
```
|
||||||
|
hrp boom curl URLs [flags]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Options
|
||||||
|
|
||||||
|
```
|
||||||
|
-b, --cookie strings -b, --cookie in curl
|
||||||
|
-d, --data strings -d, --data in curl
|
||||||
|
-F, --form strings -F, --form in curl
|
||||||
|
-G, --get -G, --get in curl
|
||||||
|
-I, --head -I, --head in curl
|
||||||
|
-H, --header strings -H, --header in curl
|
||||||
|
-h, --help help for curl
|
||||||
|
-X, --request string -X, --request in curl
|
||||||
|
```
|
||||||
|
|
||||||
|
### SEE ALSO
|
||||||
|
|
||||||
|
* [hrp boom](hrp_boom.md) - run load test with boomer
|
||||||
|
|
||||||
|
###### Auto generated by spf13/cobra on 6-Jul-2022
|
||||||
@@ -28,4 +28,4 @@ hrp build $path ... [flags]
|
|||||||
|
|
||||||
* [hrp](hrp.md) - Next-Generation API Testing Solution.
|
* [hrp](hrp.md) - Next-Generation API Testing Solution.
|
||||||
|
|
||||||
###### Auto generated by spf13/cobra on 4-Jul-2022
|
###### Auto generated by spf13/cobra on 6-Jul-2022
|
||||||
|
|||||||
@@ -21,5 +21,6 @@ hrp convert $path... [flags]
|
|||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [hrp](hrp.md) - Next-Generation API Testing Solution.
|
* [hrp](hrp.md) - Next-Generation API Testing Solution.
|
||||||
|
* [hrp convert curl](hrp_convert_curl.md) - convert curl command(s) to httprunner testcase
|
||||||
|
|
||||||
###### Auto generated by spf13/cobra on 4-Jul-2022
|
###### Auto generated by spf13/cobra on 6-Jul-2022
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
## hrp convert curl
|
||||||
|
|
||||||
|
convert curl command(s) to httprunner testcase
|
||||||
|
|
||||||
|
```
|
||||||
|
hrp convert curl URLs [flags]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Options
|
||||||
|
|
||||||
|
```
|
||||||
|
-b, --cookie strings -b, --cookie in curl
|
||||||
|
-d, --data strings -d, --data in curl
|
||||||
|
-F, --form strings -F, --form in curl
|
||||||
|
-G, --get -G, --get in curl
|
||||||
|
-I, --head -I, --head in curl
|
||||||
|
-H, --header strings -H, --header in curl
|
||||||
|
-h, --help help for curl
|
||||||
|
-X, --request string -X, --request in curl
|
||||||
|
```
|
||||||
|
|
||||||
|
### SEE ALSO
|
||||||
|
|
||||||
|
* [hrp convert](hrp_convert.md) - convert to JSON/YAML/gotest/pytest testcases
|
||||||
|
|
||||||
|
###### Auto generated by spf13/cobra on 6-Jul-2022
|
||||||
@@ -16,4 +16,4 @@ hrp pytest $path ... [flags]
|
|||||||
|
|
||||||
* [hrp](hrp.md) - Next-Generation API Testing Solution.
|
* [hrp](hrp.md) - Next-Generation API Testing Solution.
|
||||||
|
|
||||||
###### Auto generated by spf13/cobra on 4-Jul-2022
|
###### Auto generated by spf13/cobra on 6-Jul-2022
|
||||||
|
|||||||
+2
-1
@@ -34,5 +34,6 @@ hrp run $path... [flags]
|
|||||||
### SEE ALSO
|
### SEE ALSO
|
||||||
|
|
||||||
* [hrp](hrp.md) - Next-Generation API Testing Solution.
|
* [hrp](hrp.md) - Next-Generation API Testing Solution.
|
||||||
|
* [hrp run curl](hrp_run_curl.md) - run API test with go engine using converted curl testcase
|
||||||
|
|
||||||
###### Auto generated by spf13/cobra on 4-Jul-2022
|
###### Auto generated by spf13/cobra on 6-Jul-2022
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
## hrp run curl
|
||||||
|
|
||||||
|
run API test with go engine using converted curl testcase
|
||||||
|
|
||||||
|
```
|
||||||
|
hrp run curl URLs [flags]
|
||||||
|
```
|
||||||
|
|
||||||
|
### Options
|
||||||
|
|
||||||
|
```
|
||||||
|
-b, --cookie strings -b, --cookie in curl
|
||||||
|
-d, --data strings -d, --data in curl
|
||||||
|
-F, --form strings -F, --form in curl
|
||||||
|
-G, --get -G, --get in curl
|
||||||
|
-I, --head -I, --head in curl
|
||||||
|
-H, --header strings -H, --header in curl
|
||||||
|
-h, --help help for curl
|
||||||
|
-X, --request string -X, --request in curl
|
||||||
|
```
|
||||||
|
|
||||||
|
### SEE ALSO
|
||||||
|
|
||||||
|
* [hrp run](hrp_run.md) - run API test with go engine
|
||||||
|
|
||||||
|
###### Auto generated by spf13/cobra on 6-Jul-2022
|
||||||
@@ -21,4 +21,4 @@ hrp startproject $project_name [flags]
|
|||||||
|
|
||||||
* [hrp](hrp.md) - Next-Generation API Testing Solution.
|
* [hrp](hrp.md) - Next-Generation API Testing Solution.
|
||||||
|
|
||||||
###### Auto generated by spf13/cobra on 4-Jul-2022
|
###### Auto generated by spf13/cobra on 6-Jul-2022
|
||||||
|
|||||||
@@ -16,4 +16,4 @@ hrp wiki [flags]
|
|||||||
|
|
||||||
* [hrp](hrp.md) - Next-Generation API Testing Solution.
|
* [hrp](hrp.md) - Next-Generation API Testing Solution.
|
||||||
|
|
||||||
###### Auto generated by spf13/cobra on 4-Jul-2022
|
###### Auto generated by spf13/cobra on 6-Jul-2022
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"project_name": "demo-with-go-plugin",
|
"project_name": "demo-with-go-plugin",
|
||||||
"create_time": "2022-07-04T14:53:59.755944+08:00",
|
"create_time": "2022-07-06T13:57:04.054424+08:00",
|
||||||
"hrp_version": "v4.1.5"
|
"hrp_version": "v4.1.6"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"project_name": "demo-with-py-plugin",
|
"project_name": "demo-with-py-plugin",
|
||||||
"create_time": "2022-07-04T14:54:00.346082+08:00",
|
"create_time": "2022-07-06T13:57:04.482633+08:00",
|
||||||
"hrp_version": "v4.1.5"
|
"hrp_version": "v4.1.6"
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-4
@@ -14,7 +14,7 @@ import (
|
|||||||
|
|
||||||
var runCurlCmd = &cobra.Command{
|
var runCurlCmd = &cobra.Command{
|
||||||
Use: "curl URLs",
|
Use: "curl URLs",
|
||||||
Short: "run API test with go engine using converted curl testcase",
|
Short: "run API test with go engine by curl command",
|
||||||
Args: cobra.MinimumNArgs(1),
|
Args: cobra.MinimumNArgs(1),
|
||||||
PreRun: func(cmd *cobra.Command, args []string) {
|
PreRun: func(cmd *cobra.Command, args []string) {
|
||||||
setLogLevel(logLevel)
|
setLogLevel(logLevel)
|
||||||
@@ -29,7 +29,7 @@ var runCurlCmd = &cobra.Command{
|
|||||||
|
|
||||||
var boomCurlCmd = &cobra.Command{
|
var boomCurlCmd = &cobra.Command{
|
||||||
Use: "curl URLs",
|
Use: "curl URLs",
|
||||||
Short: "run load test with boomer using converted curl testcase",
|
Short: "run load test with boomer by curl command",
|
||||||
Args: cobra.MinimumNArgs(1),
|
Args: cobra.MinimumNArgs(1),
|
||||||
PreRun: func(cmd *cobra.Command, args []string) {
|
PreRun: func(cmd *cobra.Command, args []string) {
|
||||||
boomer.SetUlimit(10240) // ulimit -n 10240
|
boomer.SetUlimit(10240) // ulimit -n 10240
|
||||||
@@ -46,7 +46,7 @@ var boomCurlCmd = &cobra.Command{
|
|||||||
|
|
||||||
var convertCurlCmd = &cobra.Command{
|
var convertCurlCmd = &cobra.Command{
|
||||||
Use: "curl URLs",
|
Use: "curl URLs",
|
||||||
Short: "convert curl command(s) to httprunner testcase",
|
Short: "convert curl command to httprunner testcase",
|
||||||
Args: cobra.MinimumNArgs(1),
|
Args: cobra.MinimumNArgs(1),
|
||||||
PreRun: func(cmd *cobra.Command, args []string) {
|
PreRun: func(cmd *cobra.Command, args []string) {
|
||||||
setLogLevel(logLevel)
|
setLogLevel(logLevel)
|
||||||
@@ -97,10 +97,12 @@ func makeCurlTestCase(args []string) *hrp.TestCase {
|
|||||||
}
|
}
|
||||||
casePath, err := os.Getwd()
|
casePath, err := os.Getwd()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
casePath = ""
|
||||||
|
log.Error().Err(err).Msg("get working directory failed")
|
||||||
}
|
}
|
||||||
testCase, err := tCase.ToTestCase(casePath)
|
testCase, err := tCase.ToTestCase(casePath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error().Err(err).Msg("convert testcase failed")
|
log.Error().Err(err).Msg("convert testcase to failed")
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
return testCase
|
return testCase
|
||||||
|
|||||||
@@ -66,8 +66,8 @@ func TestLoadCurlCase(t *testing.T) {
|
|||||||
// curl -F "dummyName=dummyFile" -F file1=@file1.txt -F file2=@file2.txt https://httpbin.org/post
|
// curl -F "dummyName=dummyFile" -F file1=@file1.txt -F file2=@file2.txt https://httpbin.org/post
|
||||||
if !assert.Equal(t, map[string]interface{}{
|
if !assert.Equal(t, map[string]interface{}{
|
||||||
"dummyName": "dummyFile",
|
"dummyName": "dummyFile",
|
||||||
"file1": "@file1.txt",
|
"file1": "file1.txt",
|
||||||
"file2": "@file2.txt",
|
"file2": "file2.txt",
|
||||||
}, tCase.TestSteps[3].Request.Upload) {
|
}, tCase.TestSteps[3].Request.Upload) {
|
||||||
t.Fatal()
|
t.Fatal()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# NOTE: Generated By hrp v4.1.5, DO NOT EDIT!
|
# NOTE: Generated By hrp v4.1.6, DO NOT EDIT!
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
@@ -10,6 +10,7 @@ from debugtalk import *
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import funppy
|
import funppy
|
||||||
|
|
||||||
funppy.register("get_user_agent", get_user_agent)
|
funppy.register("get_user_agent", get_user_agent)
|
||||||
funppy.register("sleep", sleep)
|
funppy.register("sleep", sleep)
|
||||||
funppy.register("sum", sum)
|
funppy.register("sum", sum)
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// NOTE: Generated By hrp v4.1.5, DO NOT EDIT!
|
// NOTE: Generated By hrp v4.1.6, DO NOT EDIT!
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
|||||||
Reference in New Issue
Block a user