Skip to content

Running Load Tests Against MyMove

pearl-truss edited this page Dec 3, 2021 · 4 revisions

Table of Contents

Running custom tests

Once you have completed the setup for this repo you can run preset commands as listed in the README.md or you can run custom tests. To run specific load testing workflows or have more control over test parameters, you will need to use a custom locust command. This will look something like:

locust -f locustfiles/<file_to_test>.py --host <local/dp3>

Ex:

locust -f locustfiles/prime.py --host local

To run the test without the web interface, add the --headless tag and some guidelines for the test (such as number of users, their hatch rate, and the time limit for the test):

locust -f locustfiles/prime.py --headless --host local --users 50 --hatch-rate 5 --run-time 60s

To control which tasks run during the test, you can filter using tags:

locust -f locustfiles/prime.py --tags prime --exclude-tags support

To specify which User classes are spawned from locustfile, add the class name to the end of the command:

locust -f locustfiles/prime.py PrimeUser

For more CLI config options, refer to the Locust docs for Configuration.

To deactivate your virtual environment once you have completed testing, enter:

pyenv deactivate

Available Workflow Tags

There are several workflows defined. You can specify what workflow(s) you want to run by entering the tag name(s) in the locust command as shown above. Listed below are the available workflows tags to test.

Prime API Workflow Tags

  • hhgMove this workflow simulates how an HHG move would flow through the PrimeAPI. This workflow utilizes both PrimeAPI and SupportAPI tasks.
  • createMTOShipmentWorkflow this work flow tests the PrimeAPI create_mto_shipment endpoint. It creates or selects an existing move, then creates shipments on the selected move.
Clone this wiki locally