itsulu-blog-publisher/addons/itsulu_blog_publisher/tests
Nicholas Riegel 7ee393afc7 feat: add performance benchmark tests for Phase 3
Created comprehensive performance test suite measuring:

TestGenerationLatency:
- Full generation pipeline latency (target: <30s with mocked LLM)
- Social copy creation overhead (target: <2s)
- Logs metrics to ir_logging for trend analysis

TestQueryCount:
- N+1 query detection with assertQueryCount()
- Generation pipeline: <50 queries
- Topic queue lookup: 1 query
- Log list view with prefetch: 2 queries

TestTokenUsageBaseline:
- Token usage baseline measurement (800-1200 tokens typical)
- Used for cost estimation and budget alerts

TestConcurrentGeneration:
- Concurrent post generation (2 slots simultaneous)
- Verifies no ID collisions or state corruption
- Both logs and posts created successfully

Tests establish SLO baselines:
- Latency P50: <30s, P99: <60s
- Token efficiency: 800-1200 per post
- Query count: <50 per generation
- Concurrent posts: 5+ without degradation
- Email latency: <5s
- Template DB prime: <60s

All tests use mocked LLM to measure local overhead only.
Production testing with real API calls will add network time.

Tagged with 'performance' for easy filtering: pytest -m performance

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-05-30 00:51:53 -04:00
..
features feat: add BDD feature files for pytest-bdd scenarios 2026-05-30 00:39:41 -04:00
__init__.py Implement LLMRouter and provider infrastructure for GREEN phase tests 2026-05-29 12:27:58 -04:00
factories.py fix: use sudo() in blog_post factory to bypass validation 2026-05-29 23:25:17 -04:00
test_bdd_steps.py fix: correct BDD step parameters and model field references 2026-05-30 00:38:53 -04:00
test_blog_generation_log.py Reorganize codebase into Odoo addon structure per ARCHITECTURE.md 2026-05-29 12:11:42 -04:00
test_blog_post_social.py fix: adjust email template tests to check synchronous fields 2026-05-30 00:43:15 -04:00
test_blog_schedule.py fix: replace cr.commit() with flush_all() for test compatibility and fix mock assertion 2026-05-30 00:19:29 -04:00
test_blog_topic.py test: fix test framework compatibility for ValidationError assertion 2026-05-29 23:12:32 -04:00
test_llm_router.py fix: update test_llm_router to use topic parameter and valid JSON mocks 2026-05-30 00:27:48 -04:00
test_performance.py feat: add performance benchmark tests for Phase 3 2026-05-30 00:51:53 -04:00