lieldulev / swagger-to-locustfile Goto Github PK
View Code? Open in Web Editor NEWA CLI tool that creates locust.io tasks file (locustfile.py) from Swagger/OpenAPI Spec.
License: ISC License
A CLI tool that creates locust.io tasks file (locustfile.py) from Swagger/OpenAPI Spec.
License: ISC License
Hello folks :),
first of all, thanks for this amazing tool!
Locust team did a lot of renaming https://docs.locust.io/en/latest/changelog.html#changelog-1-0
so when I try to run tests generated by the swagger-to-locustfile lib I get:
$ locust -f my/path/locustfile.py -H http://127.0.0.1:8000
Traceback (most recent call last):
File "/some/path/clm/bin/locust", line 8, in <module>
sys.exit(main())
File "/some/path/clm/lib/python3.8/site-packages/locust/main.py", line 125, in main
docstring, user_classes, shape_class = load_locustfile(locustfile)
File "/some/path/clm/lib/python3.8/site-packages/locust/main.py", line 82, in load_locustfile
imported = source.load_module()
File "<frozen importlib._bootstrap_external>", line 522, in _check_name_wrapper
File "<frozen importlib._bootstrap_external>", line 1027, in load_module
File "<frozen importlib._bootstrap_external>", line 852, in load_module
File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
File "<frozen importlib._bootstrap>", line 702, in _load
File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 848, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/path/to/locustfile/locustfile.py", line 34, in <module>
class MyLocust(HttpLocust):
File "/some/path/lib/python3.8/site-packages/locust/util/deprecation.py", line 27, in __new__
raise ImportError(deprecation_message)
ImportError: The HttpLocust class has been renamed to HttpUser in version 1.0. For more info see: https://docs.locust.io/en/latest/changelog.html#changelog-1-0
for example:
...
"paths": {
"/availability": {
"get": {
"x-lucust-min" : 50,
...
x-locust-default-value
for fields.x-locust-min
and x-locust-max
on endpoints (or on root level?)Currently not recognizing required parameters that are defined in the definition object and referenced from a path.
use swagger-codegen to generate a json w/o param's $ref :
swagger-codegen generate -i input.yaml -l swagger
And then use the swagger.json
output file with swagger2locustfile
Basically get
, post
, put
also accept headers
, just need to parse it.
http://docs.locust.io/en/latest/api.html#httpsession-class
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.