- Modified check_deployment.py to wait for the correct commit hash
- Now retries until the expected version is deployed (not just site responding)
- Prevents performance tests from running against old versions
- Maintains existing retry logic with proper version checking
- Only runs functionality tests after version verification passes
- Add --avatar-threshold parameter to performance tests
- Set dev environment threshold to 2500ms (vs 1000ms for prod)
- Dev environments are expected to be slower due to resource constraints
- Production keeps strict 1000ms threshold for optimal performance
- Add follow=True to Django test client requests to handle redirects
- Fix content length handling for FileResponse objects
- Local performance tests now pass correctly showing ✅ status
This resolves the issue where all avatar generation tests were showing
'Failed' status even though they were working correctly.
- Add Pillow, prettytable, and pyLibravatar to performance test jobs
- Make performance_tests.py work without Django dependencies
- Add local implementations of generate_random_email and random_string
- Fix ModuleNotFoundError: No module named 'PIL' in CI environment
- Fix flake8 redefinition warning
This resolves the pipeline failure in performance_tests_dev job.
🔧 Type Safety Improvements:
- Added typing imports (Dict, List, Any, Optional, Tuple)
- Added type hints to all 25+ methods and functions
- Added type annotations to class attributes and instance variables
- Added proper return type annotations
📝 Enhanced Code Quality:
- Class attributes: AVATAR_STYLES: List[str], AVATAR_SIZES: List[int]
- Method parameters: All parameters now have explicit types
- Return types: All methods have proper return type annotations
- Complex types: Tuple[float, float], List[Dict[str, Any]], etc.
��️ Safety Improvements:
- Added runtime checks for None values
- Proper error handling for uninitialized clients
- Better type safety for optional parameters
- Enhanced IDE support and error detection
✅ Benefits:
- Better autocomplete and refactoring support
- Types serve as inline documentation
- Catch type-related errors before runtime
- Easier maintenance and collaboration
- Follows modern Python best practices
All functionality preserved and tested successfully.
Major enhancements to scripts/performance_tests.py:
🚀 Features Added:
- Complete avatar style coverage (identicon, monsterid, robohash, pagan, retro, wavatar, mm, mmng)
- All sizes tested (80px, 256px) for each style
- Cache hit/miss tracking and display
- Random email generation for realistic testing
- Full libravatar URL generation using official library
- Professional table output with PrettyTable
📊 Display Improvements:
- Perfect alignment with PrettyTable library
- Visual dividers between avatar styles
- Status icons (✅ success, ⚠️ mixed, ❌ failed)
- Cache status indicators (hit/miss/mixed/error)
- Email address and example URL display
- Grouped results by avatar style with averages
🔧 Technical Improvements:
- Integrated libravatar library for URL generation
- Replaced manual URL construction with proper library calls
- Enhanced error handling and reporting
- Added prettytable dependency to requirements.txt
- Improved code organization and maintainability
🎯 Testing Coverage:
- 8 avatar styles × 2 sizes = 16 test combinations
- Cache performance testing with hit/miss analysis
- Concurrent load testing with cache statistics
- Both local and remote testing modes supported
The performance tests now provide comprehensive, professional output
that's easy to read and analyze, with complete coverage of all
avatar generation functionality.