zitadel/load-test
Tim Möhlmann 65e24b67da
chore(load-test): disable userinfo after JWT profile (#8927)
# Which Problems Are Solved

Load-test requires single endpoint to be used for each test type.

# How the Problems Are Solved

Remove userinfo call from machine tests.

# Additional Changes

- Add load-test/.env to gitignore.

# Additional Context

- Related to #4424
2024-11-19 09:53:07 +01:00
..
src chore(load-test): disable userinfo after JWT profile (#8927) 2024-11-19 09:53:07 +01:00
.babelrc chore: init load tests (#7635) 2024-04-18 12:21:07 +03:00
.gitignore chore(load-test): disable userinfo after JWT profile (#8927) 2024-11-19 09:53:07 +01:00
.prettierrc chore: init load tests (#7635) 2024-04-18 12:21:07 +03:00
Makefile chore(load-test): add csv output (#8783) 2024-10-17 22:15:55 +03:00
package-lock.json chore(deps-dev): bump webpack from 5.89.0 to 5.95.0 in /load-test (#8726) 2024-10-08 14:33:15 +02:00
package.json chore(deps-dev): bump webpack from 5.89.0 to 5.95.0 in /load-test (#8726) 2024-10-08 14:33:15 +02:00
README.md test(load): add machine jwt profile test for a single user (#8593) 2024-09-11 09:23:24 +00:00
tsconfig.json chore: init load tests (#7635) 2024-04-18 12:21:07 +03:00
webpack.config.js test(load): machine jwt profile grant (#8482) 2024-08-27 13:06:03 +00:00

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 is 200s)
  • ZITADEL_HOST: URL of ZITADEL (default is http://localhost:8080)

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 ui
  • make machine_pat_login
    setup: creates machines and a pat for each machine
    test: calls user info endpoint with the given pats
  • make machine_client_credentials_login
    setup: creates machines and a client credential secret for each machine
    test: calls token endpoint with the client_credentials grant type.
  • make user_info
    setup: creates human users and signs them in
    test: calls user info endpoint using the given humans
  • make manipulate_user
    test: creates a human, updates its profile, locks the user and then deletes it
  • make 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 JWTs
  • make add_session
    setup: creates human users
    test: creates new sessions with user id check
  • make machine_jwt_profile_grant
    setup: generates private/public key, creates machine users, adds a key
    test: creates a token and calls user info
  • make 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