This project uses Locust to perform load testing on web applications. Locust is an easy-to-use and highly scalable load testing tool.
### Cloning the repository
git clone https://github.com/AlexAlexandreAlves/locust-performance-test.git
### Run through the venv (virtual environment), for this, you need to create and activate it first
python3 -m venv {$name}
source {$name}/bin/activate
### Copy all folders and files in the main project and past into your recent created env-folder, and then install the dependencies:
cd {your-venv-folder}
pip install -r requirements.txtlocust -f activities_get_test.py- Wheater execute the test out of the "tests" folder:
locust -f <environment_name>/tests/activities_post_test.py --headless -u 10 -r 1 --run-time 15s --logfile locust.log- Wheater execute the test inside the "tests" folder:
locust -f activities_post_test.py --headless -u 10 -r 1 --run-time 15s --processes {number_of_processes} --logfile locust.logdocker build -t locust-test .docker run --rm -it -p 8089:8089 locust-test- Create a virtual environment: python3 -m venv
environment_name - Activate the virtual environment: source
environment_name/bin/activate - Install dependencies: pip install -r requirements.txt
- Execute Locust with web interface: locust -f
locustfile.py - Execute a specific test in headless mode:
locust -f
environment_name/tests/activities_post_test.py --headless -u 10 -r 1 --run-time 15s --logfile locust.log - Execute with multiple processes:
locust -f activities_post_test.py --headless -u 10 -r 1 --run-time 15s --processes
number_of_processes--logfile locust.log - Build Docker image: docker build -t locust-test .
- Execute Docker container: docker run --rm -it -p 8089:8089 locust-test
Contributions are welcome! Feel free to open issues or pull requests.
This project is licensed under the MIT License.