Commit f96de406 by flyxiaozhu

测试

parent 05d6280d
...@@ -60,18 +60,32 @@ erp2.0 service-api test ...@@ -60,18 +60,32 @@ erp2.0 service-api test
| 1 | 0 | 1 | 模拟一个用户调用一次接口 | | 1 | 0 | 1 | 模拟一个用户调用一次接口 |
2.请求结果:正常 2.请求结果:正常
![img](doc/status.png)
* 其中 关闭待支付订单 接口,因没有待支付商品数据,所以测试不通过
3.聚合报告 3.聚合报告
![img](doc/rest.png)
4.参数说明
![img](doc/param.png)
#### 4.接口压力测试
1.说明
同步定时器 Synchronizing Timer,可以实现理论上的并发, 即集结了一定数量后,同时发送请求。
* 线程组设置
![img](doc/group.png)
* 同步定时器设置
![img](doc/timer.png)
* 其中:线程组 >= 同步定时器设置的线程数,同步定时器计算超时时间方法参考(毫秒): 并发数量 * 1000 / (线程数/在多少时间启动这么多线程)
#### 4.接口压力测试 2.容忍度
1.容忍度 所有请求的平均响应时间(Average):< 10s
单个请求的平均响应时间(Average):< 10s
错误率(ERROR):<= 10% 错误率(ERROR):<= 10%
2.需压力测试的接口列表 3.需压力测试的接口列表
| 接口名称 | 接口地址 | | 接口名称 | 接口地址 |
| --- | --- | | --- | --- |
...@@ -81,20 +95,19 @@ erp2.0 service-api test ...@@ -81,20 +95,19 @@ erp2.0 service-api test
| 测试编号 | 线程数 | Reamp-Up时间(秒) | 循环次数 | 描述 | | 测试编号 | 线程数 | Reamp-Up时间(秒) | 循环次数 | 描述 |
| --- | --- | --- | --- | --- | | --- | --- | --- | --- | --- |
| 1-1 | 100 | 0 | 1 | 模拟100个用户同时调用登陆然后调用创建订单接口1次 | | 1-1 | 200 | 0 | 1 | 模拟200个用户循环调用创建订单接口1次 |
| 1-2 | 500 | 0 | 1 | 模拟500个用户同时调用登陆然后调用创建订单接口1次 | | 1-2 | 500 | 0 | 1 | 模拟500个用户循环调用创建订单接口1次 |
| 1-3 | 300 | 0 | 1 | 模拟300个用户同时调用登陆然后调用创建订单接口1次 | | 1-3 | 300 | 0 | 1 | 模拟300个用户循环调用创建订单接口1次 |
3.聚合报告 3.聚合报告
- 测试编号 1-1 - 测试编号 1-1
![img](doc/createorder-3.png) ![img](doc/createOrder-1.png)
- 测试编号 1-2 - 测试编号 1-2
![img](doc/createorder-4.png) ![img](doc/createOrder-2.png)
- 测试编号 1-3 - 测试编号 1-3
![img](doc/createorder-5.png) ![img](doc/createOrder-3.png)
4.聚合报告分析 4.聚合报告分析
在容忍度范围下,用户登陆的并发量在60左右,订单创建的并发量在500左右 在容忍度范围下,用户登陆的并发量在60左右,订单创建的并发量在500左右
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
...@@ -420,13 +420,18 @@ ...@@ -420,13 +420,18 @@
<boolProp name="LoopController.continue_forever">false</boolProp> <boolProp name="LoopController.continue_forever">false</boolProp>
<stringProp name="LoopController.loops">1</stringProp> <stringProp name="LoopController.loops">1</stringProp>
</elementProp> </elementProp>
<stringProp name="ThreadGroup.num_threads">1</stringProp> <stringProp name="ThreadGroup.num_threads">300</stringProp>
<stringProp name="ThreadGroup.ramp_time">0</stringProp> <stringProp name="ThreadGroup.ramp_time">30</stringProp>
<boolProp name="ThreadGroup.scheduler">false</boolProp> <boolProp name="ThreadGroup.scheduler">false</boolProp>
<stringProp name="ThreadGroup.duration"></stringProp> <stringProp name="ThreadGroup.duration"></stringProp>
<stringProp name="ThreadGroup.delay"></stringProp> <stringProp name="ThreadGroup.delay"></stringProp>
</ThreadGroup> </ThreadGroup>
<hashTree> <hashTree>
<SyncTimer guiclass="TestBeanGUI" testclass="SyncTimer" testname="Synchronizing Timer" enabled="true">
<intProp name="groupSize">300</intProp>
<longProp name="timeoutInMs">30000</longProp>
</SyncTimer>
<hashTree/>
<CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie管理器" enabled="true"> <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie管理器" enabled="true">
<collectionProp name="CookieManager.cookies"/> <collectionProp name="CookieManager.cookies"/>
<boolProp name="CookieManager.clearEachIteration">true</boolProp> <boolProp name="CookieManager.clearEachIteration">true</boolProp>
...@@ -454,7 +459,7 @@ ...@@ -454,7 +459,7 @@
</HTTPSamplerProxy> </HTTPSamplerProxy>
<hashTree/> <hashTree/>
</hashTree> </hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="收货地址列表-请求" enabled="true"> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="收货地址列表-请求" enabled="false">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true">
<collectionProp name="Arguments.arguments"/> <collectionProp name="Arguments.arguments"/>
</elementProp> </elementProp>
...@@ -484,7 +489,7 @@ ...@@ -484,7 +489,7 @@
</ResponseAssertion> </ResponseAssertion>
<hashTree/> <hashTree/>
</hashTree> </hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="添加收货地址-请求" enabled="true"> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="添加收货地址-请求" enabled="false">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true">
<collectionProp name="Arguments.arguments"> <collectionProp name="Arguments.arguments">
<elementProp name="addressee" elementType="HTTPArgument"> <elementProp name="addressee" elementType="HTTPArgument">
...@@ -598,7 +603,7 @@ ...@@ -598,7 +603,7 @@
</Arguments> </Arguments>
<hashTree/> <hashTree/>
</hashTree> </hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="删除收货地址-请求" enabled="true"> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="删除收货地址-请求" enabled="false">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true">
<collectionProp name="Arguments.arguments"/> <collectionProp name="Arguments.arguments"/>
</elementProp> </elementProp>
...@@ -606,7 +611,7 @@ ...@@ -606,7 +611,7 @@
<stringProp name="HTTPSampler.port"></stringProp> <stringProp name="HTTPSampler.port"></stringProp>
<stringProp name="HTTPSampler.protocol">http</stringProp> <stringProp name="HTTPSampler.protocol">http</stringProp>
<stringProp name="HTTPSampler.contentEncoding">UTF-8</stringProp> <stringProp name="HTTPSampler.contentEncoding">UTF-8</stringProp>
<stringProp name="HTTPSampler.path">/address/delete?id=${id}</stringProp> <stringProp name="HTTPSampler.path">/address/delete?id=${address_id}</stringProp>
<stringProp name="HTTPSampler.method">GET</stringProp> <stringProp name="HTTPSampler.method">GET</stringProp>
<boolProp name="HTTPSampler.follow_redirects">true</boolProp> <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
<boolProp name="HTTPSampler.auto_redirects">false</boolProp> <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
...@@ -629,9 +634,9 @@ ...@@ -629,9 +634,9 @@
<hashTree/> <hashTree/>
<Arguments guiclass="ArgumentsPanel" testclass="Arguments" testname="参数变量" enabled="true"> <Arguments guiclass="ArgumentsPanel" testclass="Arguments" testname="参数变量" enabled="true">
<collectionProp name="Arguments.arguments"> <collectionProp name="Arguments.arguments">
<elementProp name="id" elementType="Argument"> <elementProp name="address_id" elementType="Argument">
<stringProp name="Argument.name">id</stringProp> <stringProp name="Argument.name">address_id</stringProp>
<stringProp name="Argument.value">2777</stringProp> <stringProp name="Argument.value">2782</stringProp>
<stringProp name="Argument.desc">收货地址id</stringProp> <stringProp name="Argument.desc">收货地址id</stringProp>
<stringProp name="Argument.metadata">=</stringProp> <stringProp name="Argument.metadata">=</stringProp>
</elementProp> </elementProp>
...@@ -639,7 +644,7 @@ ...@@ -639,7 +644,7 @@
</Arguments> </Arguments>
<hashTree/> <hashTree/>
</hashTree> </hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="banner组件-请求" enabled="true"> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="banner组件-请求" enabled="false">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true">
<collectionProp name="Arguments.arguments"/> <collectionProp name="Arguments.arguments"/>
</elementProp> </elementProp>
...@@ -669,7 +674,7 @@ ...@@ -669,7 +674,7 @@
</ResponseAssertion> </ResponseAssertion>
<hashTree/> <hashTree/>
</hashTree> </hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="商品区组件-请求" enabled="true"> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="商品区组件-请求" enabled="false">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true">
<collectionProp name="Arguments.arguments"/> <collectionProp name="Arguments.arguments"/>
</elementProp> </elementProp>
...@@ -699,7 +704,7 @@ ...@@ -699,7 +704,7 @@
</ResponseAssertion> </ResponseAssertion>
<hashTree/> <hashTree/>
</hashTree> </hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="组件列表-请求" enabled="true"> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="组件列表-请求" enabled="false">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true">
<collectionProp name="Arguments.arguments"/> <collectionProp name="Arguments.arguments"/>
</elementProp> </elementProp>
...@@ -729,7 +734,7 @@ ...@@ -729,7 +734,7 @@
</ResponseAssertion> </ResponseAssertion>
<hashTree/> <hashTree/>
</hashTree> </hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="商品详情-请求" enabled="true"> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="商品详情-请求" enabled="false">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true">
<collectionProp name="Arguments.arguments"/> <collectionProp name="Arguments.arguments"/>
</elementProp> </elementProp>
...@@ -770,7 +775,7 @@ ...@@ -770,7 +775,7 @@
</Arguments> </Arguments>
<hashTree/> <hashTree/>
</hashTree> </hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="首页相关测试-请求" enabled="true"> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="首页相关测试-请求" enabled="false">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true">
<collectionProp name="Arguments.arguments"/> <collectionProp name="Arguments.arguments"/>
</elementProp> </elementProp>
...@@ -878,7 +883,7 @@ ...@@ -878,7 +883,7 @@
<hashTree> <hashTree>
<ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true"> <ResponseAssertion guiclass="AssertionGui" testclass="ResponseAssertion" testname="响应断言" enabled="true">
<collectionProp name="Asserion.test_strings"> <collectionProp name="Asserion.test_strings">
<stringProp name="-656917012">&quot;code&quot;:22300</stringProp> <stringProp name="67791721">&quot;code&quot;:0</stringProp>
</collectionProp> </collectionProp>
<stringProp name="Assertion.custom_message"></stringProp> <stringProp name="Assertion.custom_message"></stringProp>
<stringProp name="Assertion.test_field">Assertion.response_data</stringProp> <stringProp name="Assertion.test_field">Assertion.response_data</stringProp>
...@@ -940,7 +945,7 @@ ...@@ -940,7 +945,7 @@
</Arguments> </Arguments>
<hashTree/> <hashTree/>
</hashTree> </hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="订单列表-请求" enabled="true"> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="订单列表-请求" enabled="false">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true">
<collectionProp name="Arguments.arguments"/> <collectionProp name="Arguments.arguments"/>
</elementProp> </elementProp>
...@@ -970,7 +975,7 @@ ...@@ -970,7 +975,7 @@
</ResponseAssertion> </ResponseAssertion>
<hashTree/> <hashTree/>
</hashTree> </hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="订单详情-请求" enabled="true"> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="订单详情-请求" enabled="false">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true">
<collectionProp name="Arguments.arguments"/> <collectionProp name="Arguments.arguments"/>
</elementProp> </elementProp>
...@@ -1011,7 +1016,7 @@ ...@@ -1011,7 +1016,7 @@
</Arguments> </Arguments>
<hashTree/> <hashTree/>
</hashTree> </hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="下单预检查-请求" enabled="true"> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="下单预检查-请求" enabled="false">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true">
<collectionProp name="Arguments.arguments"/> <collectionProp name="Arguments.arguments"/>
</elementProp> </elementProp>
...@@ -1052,7 +1057,7 @@ ...@@ -1052,7 +1057,7 @@
</ResponseAssertion> </ResponseAssertion>
<hashTree/> <hashTree/>
</hashTree> </hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="关闭待支付订单-请求" enabled="true"> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="关闭待支付订单-请求" enabled="false">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true">
<collectionProp name="Arguments.arguments"/> <collectionProp name="Arguments.arguments"/>
</elementProp> </elementProp>
...@@ -1093,7 +1098,7 @@ ...@@ -1093,7 +1098,7 @@
</Arguments> </Arguments>
<hashTree/> <hashTree/>
</hashTree> </hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="查询物流信息-请求" enabled="true"> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="查询物流信息-请求" enabled="false">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true">
<collectionProp name="Arguments.arguments"/> <collectionProp name="Arguments.arguments"/>
</elementProp> </elementProp>
...@@ -1140,7 +1145,7 @@ ...@@ -1140,7 +1145,7 @@
</Arguments> </Arguments>
<hashTree/> <hashTree/>
</hashTree> </hashTree>
<HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="删除订单-请求" enabled="true"> <HTTPSamplerProxy guiclass="HttpTestSampleGui" testclass="HTTPSamplerProxy" testname="删除订单-请求" enabled="false">
<elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true"> <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="用户定义的变量" enabled="true">
<collectionProp name="Arguments.arguments"/> <collectionProp name="Arguments.arguments"/>
</elementProp> </elementProp>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment