Skip to main content

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压测过程中,每个模拟的用户,都会对数据驱动的数据进行遍历,遍历结束,默认使用最后一组数据继续进行压测

关于测试报告

  1. 压测过程,实际上是 locust的运行过程,跟rtsf-http不同的是,rtsf-locust未记录日志和生成报告
  2. 但是,您可以访问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

hlocust-demo.png

Metadata

Release files for rtsf-locust 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rtsf-locust 1.1.1
File Size Uploaded Provenance Actions
rtsf-locust-1.1.1.tar.gz 5.5 kB Without provenance Details for rtsf-locust-1.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rtsf-locust 1.1.1
File Interpreter ABI Platform Actions
rtsf_locust-1.1.1-py2.py3-none-any.whl Python 3, Python 2 none any Details for rtsf_locust-1.1.1-py2.py3-none-any.whl

Total release size: 12.4 kB

Release files / rtsf-locust-1.1.1.tar.gz

Download URL rtsf-locust-1.1.1.tar.gz
Size 5.5 kB
Tags Source
SHA-256 checksum
How to use checksums
1794f8132624493631fe20091b2d3a2742fcbdff56505004fc635229312e978c
BLAKE2b-256 checksum
How to use checksums
3c664dc3bd7096bee005fce338e4b7332731e1d05bc80408a84e706d8e1ca56b
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / rtsf_locust-1.1.1-py2.py3-none-any.whl

Download URL rtsf_locust-1.1.1-py2.py3-none-any.whl
Size 6.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
54ec6b164c381f12b993ae9793e6cc27581e07d2d5f68f4eb76cab2e6e083eef
BLAKE2b-256 checksum
How to use checksums
9eddda97702e8b71d92f23f3f6bdeb27031d6270a0f36561be329cb1cd1697d0
Upload date
Uploaded using Trusted Publishing?
What is 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

Security for rtsf-locust 1.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page