You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(load-testing): integrate Locust for on-demand load testing and add related scripts
- Added Locust as a dependency in `pyproject.toml` for load testing capabilities.
- Introduced `run-load-test` script to facilitate running load tests with customizable parameters.
- Created `load/semantic_search.py` for defining the load test scenario targeting the semantic search endpoint.
- Implemented GitHub Actions workflow for automated load testing.
- Added end-to-end smoke test for semantic search in `tests/e2e/test_semantic_search.py` to validate deployment functionality.
Copy file name to clipboardExpand all lines: README.md
+30Lines changed: 30 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -89,6 +89,36 @@ poetry run pytest -v # verbose
89
89
poetry run pytest --cov=app # with coverage (needs pytest-cov)
90
90
```
91
91
92
+
### End-to-End Smoke Test (staging)
93
+
Provide the base URL of a running deployment via the `STAGING_BASE_URL` env var and run the *e2e* marked tests:
94
+
95
+
```bash
96
+
STAGING_BASE_URL=https://staging.killrvideo.com \
97
+
poetry run pytest tests/e2e -m e2e -q
98
+
```
99
+
100
+
The test performs a single semantic search request and validates the JSON schema.
101
+
102
+
### On-Demand Load Testing
103
+
A lightweight Locust scenario ships with the repo. Use the `run-load-test` helper (registered as a Poetry script) to drive a burst of semantic searches against any environment:
104
+
105
+
```bash
106
+
# 200 users, ramping at 20/s for 5 minutes
107
+
poetry run run-load-test https://staging.killrvideo.com \
108
+
--users 200 --spawn-rate 20 --duration 5m
109
+
```
110
+
111
+
Flags:
112
+
*`URL` (positional) – base URL to test
113
+
*`--users` – concurrent users (default 200)
114
+
*`--spawn-rate` – users spawned per second (default 20)
115
+
*`--duration` – test length (Locust time string, default `5m`)
0 commit comments