This repo contains code to do load testing on the integreatly-operator.
This repo currently will work with python 3.9 or better but the recommended version is python 3.11 or higher.
There are three configuration formats that are accepted. Examples of these files can be found in the configuration_samples folder.
The toml configuration format is the recommended format but requires python 3.11 or higher to be parsed. New configuration options will be added to the toml format only.
Json format has being included as alternative to the csv format.
The csv format is a historical artifact from using the hyperfoil test suite.
This file can have two names rhsso_auth.csv
or auth.csv
.
Support for csv will be removed once python 3.11 is the minium support version.
Format | Filename(s) |
---|---|
toml | config.toml |
json | auth.json |
csv | rhsso_auth.csv, auth.csv |
Which ever file format is used the configuration file needs to be placed in the same location as the locustfile.py
.
Log into a remote instances and insure the following tooling is installed
sudo dnf install python3.11 -y
pip3.11 install locust
mkdir locust
From the local machine copy the source files.
scp -i ~/.ssh/some_key.pem -r locust/* ec2-user@<remote.url>:locust
After an initial hyperfoil run copy the rhsso_auth.csv
file from /tmp/hyperfoil/runs/****/
.
Start locust and the max number of workers supported by the ec2 instances.
~/locust/start.sh
Navigate to the locust UI via http://<remote.url>:8089. Here you can start the load testing.
After the test have run and test results downloaded, locust can be stopped using ~/locust/kill.sh
Set local environment to use python 3.11. Requires 3.11 to be installed but 3.11 does not need to be the system default version.
poetry env use 3.11
Set up the local environment using poetry.
poetry install
If you are wishing not to use the mock server you can set up the environment using.
poetry install --no-dev
As the config.toml
file is required there is a sample file that will work with the mock server.
cp configuration_samples/sample_config.toml locust/config.toml
Active the mock server if needed.
poetry run uvicorn --reload mock_server.main:app
Start an instance of locust.
cd locust
poetry run locust