PetStore Load Tests¶
A load test suite for the PetStore API, a REST API for pet store testing scenarios. It is built with Locust and Faker and runs pet, user and order scenarios, with request logs on every run and optional HTML and CSV reports.
What's Covered¶
- Pets — CRUD operations
- Users — user management
- Orders — order processing
How It's Built¶
- Locust task model —
HttpUserfor concurrent users,TaskSetfor grouping tasks,SequentialTaskSetfor ordered flows (create, update, get, delete) and@taskfor frequency and order. - Data layer — generators for pets (with categories and tags), users and orders.
- Unique test data — Faker plus custom generators; pet IDs are based on timestamps.
- Task-level logging — every request and response is logged to
logs/with the task name and result. - Load profile in
config.yml— users, spawn rate, headless mode and run time (defaults: 12 users, 15s). - Reports on demand — HTML and CSV reports only with
make test-html; logs are always written.
Tech Stack¶
locust— load testing frameworkrequests— HTTP clientfaker— test data generationuv— Python package manager
Running It¶
Install dependencies, then run the load tests with or without reports:
make install
make test
make test-html