✨ feat(load-test): add load test CLI with Typer, handler registry, and Rich output#70
Conversation
Replace per-update patch.object mocking with a NoOpSession (BaseSession subclass) that intercepts all Telegram API calls at the session level, returning correct types (Message for send/edit, True for callbacks). - Add NoOpSession with typed responses for SendMessage, EditMessageText, AnswerCallbackQuery, DeleteMessage, EditMessageReplyMarkup - Uncomment make_callback_update factory for callback_language handler - Add first error traceback capture to LoadTestMetrics - Add RPS metric to the load test report - Default total-updates bumped to 1000 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…gistry Refactor monolithic bot-load-test.py into src/presentation/load_test/ with proper separation of concerns: - Typer CLI with interactive prompts and flag overrides - Registry pattern for extensible handler discovery - Extracted NoOpSession, metrics, report, and runner modules - Comprehensive README with usage examples and handler guide Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pass config directly to Dispatcher constructor, remove explicit postgres config from DBProvider, and clean up start_polling call. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pass config to Dispatcher constructor and remove explicit postgres config from DBProvider, matching the bot main.py pattern. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace plain text console output with Rich panels and tables: - Configuration panel (blue) with handler, concurrency, throughput - Results panel (green) with color-coded success/error counts - Latency panel (cyan) with highlighted p95/p99 percentiles - Error panel (red) with traceback when errors occur - Suppress aiogram.event INFO logs during test for clean progress bar Plain text format preserved for file reports. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PR Review:
|
| Category | Finding |
|---|---|
| 🔴 Critical | DI container never closed → DB connection leak |
| 🔴 Critical | import inside function at end of runner.py |
| 🟡 Suggestion | Pre-allocating all updates in memory |
| 🟡 Suggestion | message_id=0 edge case in callback_language factory |
| 🟡 Suggestion | No error handling in handler auto-discovery |
| 🔵 Minor | typer in prod deps instead of dev |
| 🔵 Minor | One non-conventional commit message |
Overall assessment: Request Changes — the container leak in particular should be addressed before merge, as repeated or large load test runs will leave stale connections. The rest are suggestions and can be addressed at discretion.
🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
PR Review:
|
Summary
Create a CLI app at
src/presentation/load_test/which allows load testing for a botpython -m src.presentation.load_test)handlers/with@register_handler, nothing else to touchreports/for archivalAlso includes minor bot layer cleanup:
bot/main.pyAdminFilterdocstringChanges
src/presentation/load_test/src/presentation/load_test/README.mdsrc/presentation/bot/main.pysrc/presentation/bot/filters/admin.pypyproject.tomltyperdep, ruff ignores for load_test, coverage omit.gitignoresrc/presentation/load_test/reports/Usage
Checklist
.gitignoreupdated for reports directory🤖 Generated with Claude Code