http(s) load testing, base on locust and rtsf-http
Project description
rtsf-locust
基于rtsf-http及locust对http(s)等api,进行性能的自动化测试
环境准备
安装rtsf-locust
pip install rtsf-locust
关于用例的编写
rtsf-locust与rtsf-http的测试用例,是同一份,唯一的区别就是在执行的时候,命令不一样.
# rtsf-http 进行接口的自动化测试
hdriver c:\test_case.yaml
httpdriver c:\test_case.yaml
#rtsf-locust 进行接口性能的自动化测试
hlocust -f c:\test_case.yaml
httplocust -f c:\test_case.yaml
rtsf-locust,具有如下特性:
- 支持yaml、json的测试用例
- 支持case的分层
- 支持case的数据驱动,在locust压测过程中,每个模拟的用户,都会对数据驱动的数据进行遍历,遍历结束,默认使用最后一组数据继续进行压测
关于测试报告
- 压测过程,实际上是 locust的运行过程,跟rtsf-http不同的是,rtsf-locust未记录日志和生成报告
- 但是,您可以访问locust的控制台,查看实时报告和日志: http://localhost:8089/
示例
压测场景:在站点pypi中搜索项目,其中项目名称,使用数据驱动的方式,写在poject.csv中,如下
# test_locust.yaml
- project:
name: xxx系统
module: xxx模块-性能
data:
- csv: projects.csv
- case:
name: search-$project_name
glob_var:
expected_result: <title>Search results
steps:
- request:
url: https://pypi.org/search/?q=$project_name
method: GET
verify:
- ${VerifyCode(200)}
- ${VerifyContain($expected_result)}
# project.csv
project_name
rtsf
rtsf-http
rtsf-app
rtsf-win
rtsf-web
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
rtsf-locust-1.1.1.tar.gz
(5.5 kB
view details)
Built Distribution
File details
Details for the file rtsf-locust-1.1.1.tar.gz
.
File metadata
- Download URL: rtsf-locust-1.1.1.tar.gz
- Upload date:
- Size: 5.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.4.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1794f8132624493631fe20091b2d3a2742fcbdff56505004fc635229312e978c |
|
MD5 | af4586fba7648a1c063d9b15aa2dbd0c |
|
BLAKE2b-256 | 3c664dc3bd7096bee005fce338e4b7332731e1d05bc80408a84e706d8e1ca56b |
File details
Details for the file rtsf_locust-1.1.1-py2.py3-none-any.whl
.
File metadata
- Download URL: rtsf_locust-1.1.1-py2.py3-none-any.whl
- Upload date:
- Size: 6.9 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.4.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54ec6b164c381f12b993ae9793e6cc27581e07d2d5f68f4eb76cab2e6e083eef |
|
MD5 | d3db7ec594981be66ea92147f91193d6 |
|
BLAKE2b-256 | 9eddda97702e8b71d92f23f3f6bdeb27031d6270a0f36561be329cb1cd1697d0 |