Testing with Locust:
Getting Started:
https://docs.locust.io/en/latest/installation.html
Useful files:
https://gist.github.com/skyrocknroll/9d434a76400f64b7947bf9ae0b6128ed
(Sample file for gRPC testing with Locust)
https://docs.locust.io/en/latest/writing-a-locustfile.html
(Breaks down different parts of Locustfile)
https://docs.locust.io/en/latest/testing-other-systems.html
(Done in xml but provides good explanation on how working with non-HTTP clients works)
Overview
- Create a locustfile.py
- In the ApiUser class add test functions,
- Testing works with try methods:
try:
CLIENT\_SERVICE\_REQUEST
cxcept xmlrpclib.Fault as e
events.request\_failure.fire(…) #Test Fails
else:
events.request\_success.fire(…) #Test Succeeds
-
Both methods take 4 parameters which are inputted manually:
-
request_type
-
name
-
response_time
-
exception (for failures), response length (for success)
-
To run, make sure the server side is running on a different tab, and then input locust --host=http://example.com
-
Go to http://127.0.0.1:8089/ on your browser, and runTesting with Locust:
Getting Started:
https://docs.locust.io/en/latest/installation.html
Useful files:
https://gist.github.com/skyrocknroll/9d434a76400f64b7947bf9ae0b6128ed
(Sample file for gRPC testing with Locust)
https://docs.locust.io/en/latest/writing-a-locustfile.html
(Breaks down different parts of Locustfile)
https://docs.locust.io/en/latest/testing-other-systems.html
(Done in xml but provides good explanation on how working with non-HTTP clients works)
Overview
- Create a locustfile.py
- In the ApiUser class add test functions,
- Testing works with try methods:
try:
CLIENT\_SERVICE\_REQUEST
cxcept xmlrpclib.Fault as e
events.request\_failure.fire(…) #Test Fails
else:
events.request\_success.fire(…) #Test Succeeds
-
Both methods take 4 parameters which are inputted manually:
-
request_type
-
name
-
response_time
-
exception (for failures), response length (for success)
-
To run, make sure the server side is running on a different tab, and then input locust --host=http://example.com
-
Go to http://127.0.0.1:8089/ on your browser, and run