See the Savant setup below if you do not yet have Savant configured.
sb int
If you want to run load tests, you have probably already figured this part out.
All of this is optional and will depend upon what you want your tests to do. However, to use the provided examples here, start with these setup steps.
- Setup an API key.
- If you're a FusionAuth developer, run
sb config
which will insert an API key into the database. - If you're just an everyday average FusionAuth enthusiast, add an API key however you know how. The examples will expect an API key of
bf69486b-4733-4470-a592-f1bfce7af580
but this can be modified to your liking. - The key must be a super user key or have permissions to add users and applications as well as log users in. It must work for all tenants.
- If you're a FusionAuth developer, run
- Set up a tenant. The examples will expect a tenant id of
efb21cfc-fa60-46f4-9598-889151e58517
but that can be modified if you want. - Setup an Application
- If needed, update
./src/main/script/setupApplication.sh
. Change the name of the host where FusionAuth runs, if not running it locally. - Run
./src/main/script/setupApplication.sh
- If needed, update
You may also want to change the factor
in the User-Registrations.json
file. With no changes, it is 1
which is not very realistic. For a typical FusionAuth deployment, the default is 24000
.
The load tests are all configured to run against local.fusionauth.io
. You can run load tests against a FusionAuth instance running at a different hostname, you just need to update the url
key of each load test JSON file.
"url": "https://local.fusionauth.io",
Before you can log users in, you need to create users. This load test will create users with a registration.
Register users, see src/main/resources/User-Registrations.json
for the test definition.
cd build/dist
./load-test.sh User-Registrations.json
Run login tests. See src/main/resources/User-Logins.json
for the test definition.
cd build/dist
./load-test.sh User-Logins.json
You can delete the load testing tenant you created and all the users, applications and registrations will be removed.
Feel free to review how the test harness is configured using the JSON DSL. You can add more workers, and worker directives if you like. If you make something cool, feel free to submit a PR.
If you want to dig into the code further, the FusionAuthWorkerFactory
is what takes a directive
from the Foreman
and builds a worker to satisfy the directive.
Note: This project uses the Savant build tool. To compile using Savant, follow these instructions:
mkdir ~/savant
cd ~/savant
wget http://savant.inversoft.org/org/savantbuild/savant-core/2.0.0-RC.7/savant-2.0.0-RC.7.tar.gz
tar xvfz savant-2.0.0-RC.7.tar.gz
ln -s ./savant-2.0.0-RC.7 current
export PATH=$PATH:~/savant/current/bin/
Then, perform an integration build of the project by running:
$ sb int