Skip to content

ISPP-2425-G9/load_tests

Load_tests

This is a project used to make load tests in the backend using Locust.

Installing local enviroment

You will have to activate a local python enviroment in case that you want to insolate dependencies. You can do this following these steps

In Linux

python -m venv venv 
source venv/bin/activate
pip install -r requirements.txt

In Windows

Using command promt

python -m venv venv 
.\venv\Scripts\activate
pip install -r requirements.txt

Using powershell

python -m venv venv 
.\venv\Scripts\activate.bat
pip install -r requirements.txt

How to run tests

Locust will be accesible in http://localhost:8089, so make sure you have that port free. Take into account that at least you will need 15 users (one per testing class), but we strongly recommend 20.

In order to run all tests you can run the following command:

locust -f locustfile.py

If you want to run specific module you can run all modules tests with these commands:

  • For running all Admin tests

    locust -f admin\AdminLoadTests.py
    
  • For running all Company tests

    locust -f company\CompanyLoadTests.py
    
  • For running all Customer Free tests

    locust -f customer\CustomerFreeLoadTests.py
    
  • For running all Customer Premium tests

    locust -f customer/CustomerPremiumLoadTests.py
    
  • For running both Customer and Customer Premium tests

    locust -f customer\CustomerFreeAndPremiumTests.py
    

Running just a specific class

If you just want to run one specific class you can do it running only the file or indicating the class

  • Selecting the file:

    locust -f relativeRouteToYourFile
    

    Example: locust -f anonymous\status.py

  • Selecting the class:

    locust -f locustfile.py --class nameOfTheClassThatYouWantToRun
    

    Example: locust -f locustfile.py --class checkStatus

About

Project in Python made to test Caronte API developed by @Dangalcan

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages