mirror of
https://github.com/zitadel/zitadel.git
synced 2025-02-28 20:17:23 +00:00

# Which Problems Are Solved We currently are not able to benchmark the performance of the session api # How the Problems Are Solved Load tests were added to - use sessions in oidc tokens analog https://zitadel.com/docs/guides/integrate/login-ui/oidc-standard # Additional Context - Closes https://github.com/zitadel/zitadel/issues/7847
Load Tests
This package contains code for load testing specific endpoints of ZITADEL using k6.
Prerequisite
Structure
The use cases under tests are defined in src/use_cases
. The implementation of ZITADEL resources and calls are located under src
.
Execution
Env vars
VUS
: Amount of parallel processes execute the test (default is 20)DURATION
: Defines how long the tests are executed (default is200s
)ZITADEL_HOST
: URL of ZITADEL (default ishttp://localhost:8080
)ADMIN_LOGIN_NAME
: Loginanme of a human user withIAM_OWNER
-roleADMIN_PASSWORD
: password of the human user
To setup the tests we use the credentials of console and log in using an admin. The user must be able to create organizations and all resources inside organizations.
ADMIN_LOGIN_NAME
:zitadel-admin@zitadel.localhost
ADMIN_PASSWORD
:Password1!
Test
Before you run the tests you need an initialized user. The tests don't implement the change password screen during login.
make human_password_login
setup: creates human users
test: uses the previously created humans to sign in using the login uimake machine_pat_login
setup: creates machines and a pat for each machine
test: calls user info endpoint with the given patsmake machine_client_credentials_login
setup: creates machines and a client credential secret for each machine
test: calls token endpoint with theclient_credentials
grant type.make user_info
setup: creates human users and signs them in
test: calls user info endpoint using the given humansmake manipulate_user
test: creates a human, updates its profile, locks the user and then deletes itmake introspect
setup: creates projects, one api per project, one key per api and generates the jwt from the given keys
test: calls introspection endpoint using the given JWTsmake add_session
setup: creates human users
test: creates new sessions with user id checkmake oidc_session
setup: creates a machine user to create the auth request and session.
test: creates an auth request, a session and links the session to the auth request. Implementation of this flow.make otp_session
setup: creates 1 human user for each VU and adds email OTP to it
test: creates a session based on the login name of the user, sets the email OTP challenge to the session and afterwards checks the OTP codemake password_session
setup: creates 1 human user for each VU and adds email OTP to it
test: creates a session based on the login name of the user and checks for the password on a second stepmake machine_jwt_profile_grant
setup: generates private/public key, creates machine users, adds a key
test: creates a token and calls user infomake machine_jwt_profile_grant_single_user
setup: generates private/public key, creates machine user, adds a key
test: creates a token and calls user info in parallel for the same user