diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 17ab8c0d..b6656601 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -1,13 +1,15 @@ # Release History -## v4.0.0-beta2 (2022-04-25) +## v4.0.0-beta2 (2022-05-03) **go version** - feat: add builtin function `environ`/`ENV` - fix: demo function compatibility - fix #1240: losing host port in har2case +- fix: concurrent map write in parameterize - change: get hrp version from aliyun OSS file when installing +- change: report more load testing metrics to prometheus ## v4.0.0-beta (2022-04-24) diff --git a/docs/cmd/hrp.md b/docs/cmd/hrp.md index 4a0c55d0..ef528f9d 100644 --- a/docs/cmd/hrp.md +++ b/docs/cmd/hrp.md @@ -36,4 +36,4 @@ Copyright 2017 debugtalk * [hrp run](hrp_run.md) - run API test with go engine * [hrp startproject](hrp_startproject.md) - create a scaffold project -###### Auto generated by spf13/cobra on 24-Apr-2022 +###### Auto generated by spf13/cobra on 3-May-2022 diff --git a/docs/cmd/hrp_boom.md b/docs/cmd/hrp_boom.md index ebc6bf4c..fe95ddab 100644 --- a/docs/cmd/hrp_boom.md +++ b/docs/cmd/hrp_boom.md @@ -41,4 +41,4 @@ hrp boom [flags] * [hrp](hrp.md) - Next-Generation API Testing Solution. -###### Auto generated by spf13/cobra on 24-Apr-2022 +###### Auto generated by spf13/cobra on 3-May-2022 diff --git a/docs/cmd/hrp_convert.md b/docs/cmd/hrp_convert.md index 6ec6b49e..880bce0b 100644 --- a/docs/cmd/hrp_convert.md +++ b/docs/cmd/hrp_convert.md @@ -18,4 +18,4 @@ hrp convert $path... [flags] * [hrp](hrp.md) - Next-Generation API Testing Solution. -###### Auto generated by spf13/cobra on 24-Apr-2022 +###### Auto generated by spf13/cobra on 3-May-2022 diff --git a/docs/cmd/hrp_har2case.md b/docs/cmd/hrp_har2case.md index 0d15ec54..d7b6e925 100644 --- a/docs/cmd/hrp_har2case.md +++ b/docs/cmd/hrp_har2case.md @@ -24,4 +24,4 @@ hrp har2case $har_path... [flags] * [hrp](hrp.md) - Next-Generation API Testing Solution. -###### Auto generated by spf13/cobra on 24-Apr-2022 +###### Auto generated by spf13/cobra on 3-May-2022 diff --git a/docs/cmd/hrp_pytest.md b/docs/cmd/hrp_pytest.md index bc0c2437..5c59d217 100644 --- a/docs/cmd/hrp_pytest.md +++ b/docs/cmd/hrp_pytest.md @@ -16,4 +16,4 @@ hrp pytest $path ... [flags] * [hrp](hrp.md) - Next-Generation API Testing Solution. -###### Auto generated by spf13/cobra on 24-Apr-2022 +###### Auto generated by spf13/cobra on 3-May-2022 diff --git a/docs/cmd/hrp_run.md b/docs/cmd/hrp_run.md index d7581b4c..6d2f8486 100644 --- a/docs/cmd/hrp_run.md +++ b/docs/cmd/hrp_run.md @@ -34,4 +34,4 @@ hrp run $path... [flags] * [hrp](hrp.md) - Next-Generation API Testing Solution. -###### Auto generated by spf13/cobra on 24-Apr-2022 +###### Auto generated by spf13/cobra on 3-May-2022 diff --git a/docs/cmd/hrp_startproject.md b/docs/cmd/hrp_startproject.md index 3402b1c9..a8706619 100644 --- a/docs/cmd/hrp_startproject.md +++ b/docs/cmd/hrp_startproject.md @@ -20,4 +20,4 @@ hrp startproject $project_name [flags] * [hrp](hrp.md) - Next-Generation API Testing Solution. -###### Auto generated by spf13/cobra on 24-Apr-2022 +###### Auto generated by spf13/cobra on 3-May-2022 diff --git a/examples/data/a_b_c/T1_test.py b/examples/data/a_b_c/T1_test.py index d3273df7..504b3f6d 100644 --- a/examples/data/a_b_c/T1_test.py +++ b/examples/data/a_b_c/T1_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.0.0-beta +# NOTE: Generated By HttpRunner v4.0.0 # FROM: a-b.c/1.yml diff --git a/examples/data/a_b_c/T2_3_test.py b/examples/data/a_b_c/T2_3_test.py index a225b4cb..452927a9 100644 --- a/examples/data/a_b_c/T2_3_test.py +++ b/examples/data/a_b_c/T2_3_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.0.0-beta +# NOTE: Generated By HttpRunner v4.0.0 # FROM: a-b.c/2 3.yml diff --git a/examples/demo-with-go-plugin/plugin/debugtalk.go b/examples/demo-with-go-plugin/plugin/debugtalk.go index dbb37554..b3b39400 100644 --- a/examples/demo-with-go-plugin/plugin/debugtalk.go +++ b/examples/demo-with-go-plugin/plugin/debugtalk.go @@ -42,11 +42,11 @@ func TeardownHookExample(args string) string { } func GetVersion() string { - return "v4.0.0-beta" + return fungo.Version } func main() { - fungo.Register("get_httprunner_version", GetVersion) + fungo.Register("get_version", GetVersion) fungo.Register("sum_ints", SumInts) fungo.Register("sum_two_int", SumTwoInt) fungo.Register("sum_two", SumTwoInt) diff --git a/examples/demo-with-go-plugin/testcases/demo_ref_testcase.yml b/examples/demo-with-go-plugin/testcases/demo_ref_testcase.yml index 7c9bcd19..0743488e 100644 --- a/examples/demo-with-go-plugin/testcases/demo_ref_testcase.yml +++ b/examples/demo-with-go-plugin/testcases/demo_ref_testcase.yml @@ -24,7 +24,7 @@ teststeps: method: POST url: /post headers: - User-Agent: HttpRunner/${get_httprunner_version()} + User-Agent: funplugin/${get_version()} Content-Type: "application/x-www-form-urlencoded" data: "foo1=$foo1&foo2=$foo3" validate: diff --git a/examples/demo-with-go-plugin/testcases/demo_requests.yml b/examples/demo-with-go-plugin/testcases/demo_requests.yml index cae1b491..86d1b9cc 100644 --- a/examples/demo-with-go-plugin/testcases/demo_requests.yml +++ b/examples/demo-with-go-plugin/testcases/demo_requests.yml @@ -24,7 +24,7 @@ teststeps: foo2: $foo2 sum_v: $sum_v headers: - User-Agent: HttpRunner/${get_httprunner_version()} + User-Agent: funplugin/${get_version()} extract: foo3: "body.args.foo2" validate: @@ -41,7 +41,7 @@ teststeps: method: POST url: /post headers: - User-Agent: HttpRunner/${get_httprunner_version()} + User-Agent: funplugin/${get_version()} Content-Type: "text/plain" data: "This is expected to be sent back as part of response body: $foo1-$foo2-$foo3." validate: @@ -55,7 +55,7 @@ teststeps: method: POST url: /post headers: - User-Agent: HttpRunner/${get_httprunner_version()} + User-Agent: funplugin/${get_version()} Content-Type: "application/x-www-form-urlencoded" data: "foo1=$foo1&foo2=$foo2&foo3=$foo3" validate: diff --git a/examples/demo-with-py-plugin/debugtalk.py b/examples/demo-with-py-plugin/debugtalk.py index 180725e0..9fd41120 100644 --- a/examples/demo-with-py-plugin/debugtalk.py +++ b/examples/demo-with-py-plugin/debugtalk.py @@ -5,8 +5,8 @@ from typing import List import funppy -def get_httprunner_version(): - return "v4.0.0-beta" +def get_version(): + return funppy.__version__ def sleep(n_secs): @@ -60,7 +60,7 @@ def teardown_hook_example(name): if __name__ == "__main__": - funppy.register("get_httprunner_version", get_httprunner_version) + funppy.register("get_version", get_version) funppy.register("sum", sum) funppy.register("sum_ints", sum_ints) funppy.register("concatenate", concatenate) diff --git a/examples/demo-with-py-plugin/testcases/__init__.py b/examples/demo-with-py-plugin/testcases/__init__.py deleted file mode 100644 index 70cfba53..00000000 --- a/examples/demo-with-py-plugin/testcases/__init__.py +++ /dev/null @@ -1 +0,0 @@ -# NOTICE: Generated By HttpRunner. DO NOT EDIT! diff --git a/examples/demo-with-py-plugin/testcases/demo_ref_testcase.yml b/examples/demo-with-py-plugin/testcases/demo_ref_testcase.yml index 7c9bcd19..0743488e 100644 --- a/examples/demo-with-py-plugin/testcases/demo_ref_testcase.yml +++ b/examples/demo-with-py-plugin/testcases/demo_ref_testcase.yml @@ -24,7 +24,7 @@ teststeps: method: POST url: /post headers: - User-Agent: HttpRunner/${get_httprunner_version()} + User-Agent: funplugin/${get_version()} Content-Type: "application/x-www-form-urlencoded" data: "foo1=$foo1&foo2=$foo3" validate: diff --git a/examples/demo-with-py-plugin/testcases/demo_ref_testcase_test.py b/examples/demo-with-py-plugin/testcases/demo_ref_testcase_test.py deleted file mode 100644 index e88b8d08..00000000 --- a/examples/demo-with-py-plugin/testcases/demo_ref_testcase_test.py +++ /dev/null @@ -1,60 +0,0 @@ -# NOTE: Generated By HttpRunner v3.1.11 -# FROM: testcases/demo_ref_testcase.yml - - -import sys -from pathlib import Path - -sys.path.insert(0, str(Path(__file__).parent.parent)) - - -from httprunner import HttpRunner, Config, Step, RunRequest, RunTestCase - -from testcases.demo_requests_test import TestCaseDemoRequests as DemoRequests - - -class TestCaseDemoRefTestcase(HttpRunner): - - config = ( - Config("request methods testcase: reference testcase") - .variables( - **{ - "foo1": "testsuite_config_bar1", - "expect_foo1": "testsuite_config_bar1", - "expect_foo2": "config_bar2", - } - ) - .base_url("https://postman-echo.com") - .verify(False) - ) - - teststeps = [ - Step( - RunTestCase("request with functions") - .with_variables( - **{"foo1": "testcase_ref_bar1", "expect_foo1": "testcase_ref_bar1"} - ) - .call(DemoRequests) - .export(*["foo3"]) - ), - Step( - RunRequest("post form data") - .with_variables(**{"foo1": "bar1"}) - .post("/post") - .with_headers( - **{ - "User-Agent": "HttpRunner/${get_httprunner_version()}", - "Content-Type": "application/x-www-form-urlencoded", - } - ) - .with_data("foo1=$foo1&foo2=$foo3") - .validate() - .assert_equal("status_code", 200) - .assert_equal("body.form.foo1", "bar1") - .assert_equal("body.form.foo2", "bar21") - ), - ] - - -if __name__ == "__main__": - TestCaseDemoRefTestcase().test_start() diff --git a/examples/demo-with-py-plugin/testcases/demo_requests.yml b/examples/demo-with-py-plugin/testcases/demo_requests.yml index cae1b491..86d1b9cc 100644 --- a/examples/demo-with-py-plugin/testcases/demo_requests.yml +++ b/examples/demo-with-py-plugin/testcases/demo_requests.yml @@ -24,7 +24,7 @@ teststeps: foo2: $foo2 sum_v: $sum_v headers: - User-Agent: HttpRunner/${get_httprunner_version()} + User-Agent: funplugin/${get_version()} extract: foo3: "body.args.foo2" validate: @@ -41,7 +41,7 @@ teststeps: method: POST url: /post headers: - User-Agent: HttpRunner/${get_httprunner_version()} + User-Agent: funplugin/${get_version()} Content-Type: "text/plain" data: "This is expected to be sent back as part of response body: $foo1-$foo2-$foo3." validate: @@ -55,7 +55,7 @@ teststeps: method: POST url: /post headers: - User-Agent: HttpRunner/${get_httprunner_version()} + User-Agent: funplugin/${get_version()} Content-Type: "application/x-www-form-urlencoded" data: "foo1=$foo1&foo2=$foo2&foo3=$foo3" validate: diff --git a/examples/demo-with-py-plugin/testcases/demo_requests_test.py b/examples/demo-with-py-plugin/testcases/demo_requests_test.py deleted file mode 100644 index b5c34bc2..00000000 --- a/examples/demo-with-py-plugin/testcases/demo_requests_test.py +++ /dev/null @@ -1,83 +0,0 @@ -# NOTE: Generated By HttpRunner v3.1.11 -# FROM: testcases/demo_requests.yml - - -from httprunner import HttpRunner, Config, Step, RunRequest, RunTestCase - - -class TestCaseDemoRequests(HttpRunner): - - config = ( - Config("request methods testcase with functions") - .variables( - **{ - "foo1": "config_bar1", - "foo2": "config_bar2", - "expect_foo1": "config_bar1", - "expect_foo2": "config_bar2", - } - ) - .base_url("https://postman-echo.com") - .verify(False) - .export(*["foo3"]) - ) - - teststeps = [ - Step( - RunRequest("get with params") - .with_variables( - **{"foo1": "bar11", "foo2": "bar21", "sum_v": "${sum_two_int(1, 2)}"} - ) - .get("/get") - .with_params(**{"foo1": "$foo1", "foo2": "$foo2", "sum_v": "$sum_v"}) - .with_headers(**{"User-Agent": "HttpRunner/${get_httprunner_version()}"}) - .extract() - .with_jmespath("body.args.foo2", "foo3") - .validate() - .assert_equal("status_code", 200) - .assert_equal("body.args.foo1", "bar11") - .assert_equal("body.args.sum_v", "3") - .assert_equal("body.args.foo2", "bar21") - ), - Step( - RunRequest("post raw text") - .with_variables(**{"foo1": "bar12", "foo3": "bar32"}) - .post("/post") - .with_headers( - **{ - "User-Agent": "HttpRunner/${get_httprunner_version()}", - "Content-Type": "text/plain", - } - ) - .with_data( - "This is expected to be sent back as part of response body: $foo1-$foo2-$foo3." - ) - .validate() - .assert_equal("status_code", 200) - .assert_equal( - "body.data", - "This is expected to be sent back as part of response body: bar12-$expect_foo2-bar32.", - ) - ), - Step( - RunRequest("post form data") - .with_variables(**{"foo2": "bar23"}) - .post("/post") - .with_headers( - **{ - "User-Agent": "HttpRunner/${get_httprunner_version()}", - "Content-Type": "application/x-www-form-urlencoded", - } - ) - .with_data("foo1=$foo1&foo2=$foo2&foo3=$foo3") - .validate() - .assert_equal("status_code", 200) - .assert_equal("body.form.foo1", "$expect_foo1") - .assert_equal("body.form.foo2", "bar23") - .assert_equal("body.form.foo3", "bar21") - ), - ] - - -if __name__ == "__main__": - TestCaseDemoRequests().test_start() diff --git a/examples/httpbin/basic_test.py b/examples/httpbin/basic_test.py index d13c87ac..42733b08 100644 --- a/examples/httpbin/basic_test.py +++ b/examples/httpbin/basic_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.0.0-beta +# NOTE: Generated By HttpRunner v4.0.0 # FROM: basic.yml diff --git a/examples/httpbin/hooks_test.py b/examples/httpbin/hooks_test.py index 96302d35..cb249adb 100644 --- a/examples/httpbin/hooks_test.py +++ b/examples/httpbin/hooks_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.0.0-beta +# NOTE: Generated By HttpRunner v4.0.0 # FROM: hooks.yml diff --git a/examples/httpbin/load_image_test.py b/examples/httpbin/load_image_test.py index a43f5e75..9c56466c 100644 --- a/examples/httpbin/load_image_test.py +++ b/examples/httpbin/load_image_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.0.0-beta +# NOTE: Generated By HttpRunner v4.0.0 # FROM: load_image.yml diff --git a/examples/httpbin/upload_test.py b/examples/httpbin/upload_test.py index 394ecbb6..56d2c1c8 100644 --- a/examples/httpbin/upload_test.py +++ b/examples/httpbin/upload_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.0.0-beta +# NOTE: Generated By HttpRunner v4.0.0 # FROM: upload.yml diff --git a/examples/httpbin/validate_test.py b/examples/httpbin/validate_test.py index ae948113..2a3e3e0f 100644 --- a/examples/httpbin/validate_test.py +++ b/examples/httpbin/validate_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.0.0-beta +# NOTE: Generated By HttpRunner v4.0.0 # FROM: validate.yml diff --git a/examples/postman_echo/cookie_manipulation/hardcode_test.py b/examples/postman_echo/cookie_manipulation/hardcode_test.py index f8d58a4d..efc33f10 100644 --- a/examples/postman_echo/cookie_manipulation/hardcode_test.py +++ b/examples/postman_echo/cookie_manipulation/hardcode_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.0.0-beta +# NOTE: Generated By HttpRunner v4.0.0 # FROM: cookie_manipulation/hardcode.yml diff --git a/examples/postman_echo/cookie_manipulation/set_delete_cookies_test.py b/examples/postman_echo/cookie_manipulation/set_delete_cookies_test.py index 371a5372..73d9928d 100644 --- a/examples/postman_echo/cookie_manipulation/set_delete_cookies_test.py +++ b/examples/postman_echo/cookie_manipulation/set_delete_cookies_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.0.0-beta +# NOTE: Generated By HttpRunner v4.0.0 # FROM: cookie_manipulation/set_delete_cookies.yml diff --git a/examples/postman_echo/request_methods/hardcode_test.py b/examples/postman_echo/request_methods/hardcode_test.py index a2b49836..a7fa8d14 100644 --- a/examples/postman_echo/request_methods/hardcode_test.py +++ b/examples/postman_echo/request_methods/hardcode_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.0.0-beta +# NOTE: Generated By HttpRunner v4.0.0 # FROM: request_methods/hardcode.yml diff --git a/examples/postman_echo/request_methods/request_with_functions_test.py b/examples/postman_echo/request_methods/request_with_functions_test.py index 8688765f..a6f8ce0b 100644 --- a/examples/postman_echo/request_methods/request_with_functions_test.py +++ b/examples/postman_echo/request_methods/request_with_functions_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.0.0-beta +# NOTE: Generated By HttpRunner v4.0.0 # FROM: request_methods/request_with_functions.yml diff --git a/examples/postman_echo/request_methods/request_with_parameters_test.py b/examples/postman_echo/request_methods/request_with_parameters_test.py index 5c6271a8..56e7c249 100644 --- a/examples/postman_echo/request_methods/request_with_parameters_test.py +++ b/examples/postman_echo/request_methods/request_with_parameters_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.0.0-beta +# NOTE: Generated By HttpRunner v4.0.0 # FROM: request_methods/request_with_parameters.yml diff --git a/examples/postman_echo/request_methods/request_with_testcase_reference_test.py b/examples/postman_echo/request_methods/request_with_testcase_reference_test.py index 6a55b63a..2ed2b6e9 100644 --- a/examples/postman_echo/request_methods/request_with_testcase_reference_test.py +++ b/examples/postman_echo/request_methods/request_with_testcase_reference_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.0.0-beta +# NOTE: Generated By HttpRunner v4.0.0 # FROM: request_methods/request_with_testcase_reference.yml diff --git a/examples/postman_echo/request_methods/request_with_variables_test.py b/examples/postman_echo/request_methods/request_with_variables_test.py index 0c7c0f77..788a0a85 100644 --- a/examples/postman_echo/request_methods/request_with_variables_test.py +++ b/examples/postman_echo/request_methods/request_with_variables_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.0.0-beta +# NOTE: Generated By HttpRunner v4.0.0 # FROM: request_methods/request_with_variables.yml diff --git a/examples/postman_echo/request_methods/validate_with_functions_test.py b/examples/postman_echo/request_methods/validate_with_functions_test.py index 2ad1b58f..0b1f8966 100644 --- a/examples/postman_echo/request_methods/validate_with_functions_test.py +++ b/examples/postman_echo/request_methods/validate_with_functions_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.0.0-beta +# NOTE: Generated By HttpRunner v4.0.0 # FROM: request_methods/validate_with_functions.yml diff --git a/examples/postman_echo/request_methods/validate_with_variables_test.py b/examples/postman_echo/request_methods/validate_with_variables_test.py index 26fa76bc..36b500a7 100644 --- a/examples/postman_echo/request_methods/validate_with_variables_test.py +++ b/examples/postman_echo/request_methods/validate_with_variables_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.0.0-beta +# NOTE: Generated By HttpRunner v4.0.0 # FROM: request_methods/validate_with_variables.yml diff --git a/hrp/internal/scaffold/templates/plugin/debugtalk.go b/hrp/internal/scaffold/templates/plugin/debugtalk.go index dbb37554..b3b39400 100644 --- a/hrp/internal/scaffold/templates/plugin/debugtalk.go +++ b/hrp/internal/scaffold/templates/plugin/debugtalk.go @@ -42,11 +42,11 @@ func TeardownHookExample(args string) string { } func GetVersion() string { - return "v4.0.0-beta" + return fungo.Version } func main() { - fungo.Register("get_httprunner_version", GetVersion) + fungo.Register("get_version", GetVersion) fungo.Register("sum_ints", SumInts) fungo.Register("sum_two_int", SumTwoInt) fungo.Register("sum_two", SumTwoInt) diff --git a/hrp/internal/scaffold/templates/plugin/debugtalk.py b/hrp/internal/scaffold/templates/plugin/debugtalk.py index 180725e0..9fd41120 100644 --- a/hrp/internal/scaffold/templates/plugin/debugtalk.py +++ b/hrp/internal/scaffold/templates/plugin/debugtalk.py @@ -5,8 +5,8 @@ from typing import List import funppy -def get_httprunner_version(): - return "v4.0.0-beta" +def get_version(): + return funppy.__version__ def sleep(n_secs): @@ -60,7 +60,7 @@ def teardown_hook_example(name): if __name__ == "__main__": - funppy.register("get_httprunner_version", get_httprunner_version) + funppy.register("get_version", get_version) funppy.register("sum", sum) funppy.register("sum_ints", sum_ints) funppy.register("concatenate", concatenate) diff --git a/hrp/internal/scaffold/templates/testcases/demo_ref_testcase.yml b/hrp/internal/scaffold/templates/testcases/demo_ref_testcase.yml index 7c9bcd19..0743488e 100644 --- a/hrp/internal/scaffold/templates/testcases/demo_ref_testcase.yml +++ b/hrp/internal/scaffold/templates/testcases/demo_ref_testcase.yml @@ -24,7 +24,7 @@ teststeps: method: POST url: /post headers: - User-Agent: HttpRunner/${get_httprunner_version()} + User-Agent: funplugin/${get_version()} Content-Type: "application/x-www-form-urlencoded" data: "foo1=$foo1&foo2=$foo3" validate: diff --git a/hrp/internal/scaffold/templates/testcases/demo_ref_testcase_test.py b/hrp/internal/scaffold/templates/testcases/demo_ref_testcase_test.py index deae0a81..714030cd 100644 --- a/hrp/internal/scaffold/templates/testcases/demo_ref_testcase_test.py +++ b/hrp/internal/scaffold/templates/testcases/demo_ref_testcase_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.0.0-beta +# NOTE: Generated By HttpRunner v4.0.0 # FROM: testcases/demo_ref_testcase.yml @@ -43,7 +43,7 @@ class TestCaseDemoRefTestcase(HttpRunner): .post("/post") .with_headers( **{ - "User-Agent": "HttpRunner/${get_httprunner_version()}", + "User-Agent": "funplugin/${get_version()}", "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/hrp/internal/scaffold/templates/testcases/demo_requests.yml b/hrp/internal/scaffold/templates/testcases/demo_requests.yml index cae1b491..86d1b9cc 100644 --- a/hrp/internal/scaffold/templates/testcases/demo_requests.yml +++ b/hrp/internal/scaffold/templates/testcases/demo_requests.yml @@ -24,7 +24,7 @@ teststeps: foo2: $foo2 sum_v: $sum_v headers: - User-Agent: HttpRunner/${get_httprunner_version()} + User-Agent: funplugin/${get_version()} extract: foo3: "body.args.foo2" validate: @@ -41,7 +41,7 @@ teststeps: method: POST url: /post headers: - User-Agent: HttpRunner/${get_httprunner_version()} + User-Agent: funplugin/${get_version()} Content-Type: "text/plain" data: "This is expected to be sent back as part of response body: $foo1-$foo2-$foo3." validate: @@ -55,7 +55,7 @@ teststeps: method: POST url: /post headers: - User-Agent: HttpRunner/${get_httprunner_version()} + User-Agent: funplugin/${get_version()} Content-Type: "application/x-www-form-urlencoded" data: "foo1=$foo1&foo2=$foo2&foo3=$foo3" validate: diff --git a/hrp/internal/scaffold/templates/testcases/demo_requests_test.py b/hrp/internal/scaffold/templates/testcases/demo_requests_test.py index e54a7faa..fc2ad5bb 100644 --- a/hrp/internal/scaffold/templates/testcases/demo_requests_test.py +++ b/hrp/internal/scaffold/templates/testcases/demo_requests_test.py @@ -1,4 +1,4 @@ -# NOTE: Generated By HttpRunner v4.0.0-beta +# NOTE: Generated By HttpRunner v4.0.0 # FROM: testcases/demo_requests.yml @@ -30,7 +30,7 @@ class TestCaseDemoRequests(HttpRunner): ) .get("/get") .with_params(**{"foo1": "$foo1", "foo2": "$foo2", "sum_v": "$sum_v"}) - .with_headers(**{"User-Agent": "HttpRunner/${get_httprunner_version()}"}) + .with_headers(**{"User-Agent": "funplugin/${get_version()}"}) .extract() .with_jmespath("body.args.foo2", "foo3") .validate() @@ -45,7 +45,7 @@ class TestCaseDemoRequests(HttpRunner): .post("/post") .with_headers( **{ - "User-Agent": "HttpRunner/${get_httprunner_version()}", + "User-Agent": "funplugin/${get_version()}", "Content-Type": "text/plain", } ) @@ -65,7 +65,7 @@ class TestCaseDemoRequests(HttpRunner): .post("/post") .with_headers( **{ - "User-Agent": "HttpRunner/${get_httprunner_version()}", + "User-Agent": "funplugin/${get_version()}", "Content-Type": "application/x-www-form-urlencoded", } ) diff --git a/hrp/internal/version/VERSION b/hrp/internal/version/VERSION index 46390341..f684230d 100644 --- a/hrp/internal/version/VERSION +++ b/hrp/internal/version/VERSION @@ -1 +1 @@ -v4.0.0-beta \ No newline at end of file +v4.0.0 \ No newline at end of file diff --git a/httprunner/__init__.py b/httprunner/__init__.py index cbc40932..7d424fcb 100644 --- a/httprunner/__init__.py +++ b/httprunner/__init__.py @@ -1,4 +1,4 @@ -__version__ = "v4.0.0-beta" +__version__ = "v4.0.0" __description__ = "One-stop solution for HTTP(S) testing." from httprunner.config import Config diff --git a/httprunner/make.py b/httprunner/make.py index c2b3d3b2..75a4e783 100644 --- a/httprunner/make.py +++ b/httprunner/make.py @@ -33,7 +33,7 @@ pytest_files_made_cache_mapping: Dict[Text, Text] = {} pytest_files_run_set: Set = set() __TEMPLATE__ = jinja2.Template( - """# NOTE: Generated By HttpRunner v{{ version }} + """# NOTE: Generated By HttpRunner {{ version }} # FROM: {{ testcase_path }} {% if imports_list and diff_levels > 0 %} diff --git a/pyproject.toml b/pyproject.toml index c50b5036..c5943ad9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "httprunner" -version = "v4.0.0-beta" +version = "v4.0.0" description = "One-stop solution for HTTP(S) testing." license = "Apache-2.0" readme = "README.md"