Load tests (Locust)

Performance and load testing using Locust.


Usage

splent feature:test --load
splent feature:test auth --load

Load tests live in tests/load/locustfile.py inside each feature and are not included in the default test run. Use the --load flag explicitly.


Description

Locust tests simulate concurrent users hitting the application to measure performance under load. Each feature can define its own user behavior:

from locust import HttpUser, TaskSet, task

class AuthBehavior(TaskSet):
    @task
    def login(self):
        self.client.post("/login", data={"email": "user@test.com", "password": "1234"})

class AuthUser(HttpUser):
    tasks = [AuthBehavior]
    min_wait = 5000
    max_wait = 9000

Requirements

  • The application must be running (splent product:run).
  • Locust must be installed in the environment.
  • Once running, the Locust web UI is available at http://localhost:8089.

Back to top

splent. Distributed by an LGPL license v3. Contact us: drorganvidez@us.es