Commit Graph

15 Commits

Author SHA1 Message Date
Oliver Falk
27dd40b4aa Improve CI output visibility and remove buffering
- Add flush=True to all colored_print calls for immediate output
- Add PYTHONUNBUFFERED=1 to all deployment and performance test jobs
- Replace simple sleep with countdown progress indicator
- Show 'Retrying in X seconds...' with real-time countdown
- Clear progress line after countdown completes
- Better visibility of what the script is doing during long waits
2025-10-24 13:06:57 +02:00
Oliver Falk
8fbdf35c02 Fix deployment verification: install git and improve fallback logic
- Install git in deployment verification jobs (was missing in Alpine image)
- Add string comparison fallback when git commands fail
- Safer approach: wait for deployment when commit comparison fails
- This ensures we don't run performance tests against wrong versions
- Fixes 'No such file or directory: git' error in CI
2025-10-24 12:39:08 +02:00
Oliver Falk
43b8b2abef Improve deployment verification commit checking
- Use CI_COMMIT_SHA environment variable when available (more reliable in CI)
- Add timestamp-based commit comparison as primary method
- Fallback to git merge-base for ancestry checking
- Add detailed debugging output for commit comparison
- Handle short vs long commit hash matching
- Better error handling for shallow git clones in CI
- More robust version detection and waiting logic
2025-10-24 12:07:24 +02:00
Oliver Falk
173ddaae8f Fix dev performance tests: ignore cache warnings
- Add --ignore-cache-warnings flag for dev environments
- Cache configuration may differ between dev and production
- Dev environment now ignores cache warnings to prevent false failures
- Production still validates cache performance strictly
- All other performance metrics are still validated in dev
2025-10-24 11:37:47 +02:00
Oliver Falk
03fa0fb911 Make all performance thresholds configurable for dev environment
- Add --response-threshold and --p95-threshold parameters
- Dev environment now uses relaxed thresholds:
  * Avatar generation: 2500ms (vs 1000ms prod)
  * Response time: 2500ms (vs 1000ms prod)
  * 95th percentile: 5000ms (vs 2000ms prod)
- Fixes CI failures due to dev environment being slower than production
- Production maintains strict performance standards
2025-10-24 11:16:45 +02:00
Oliver Falk
80df736433 Fix deployment verification to wait for correct version
- 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
2025-10-24 11:00:05 +02:00
Oliver Falk
7350afd988 Adjust performance thresholds for dev environment
- 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
2025-10-24 10:41:54 +02:00
Oliver Falk
5556f7bd9a Fix local performance tests: Handle Django redirects properly
- 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.
2025-10-23 19:07:23 +02:00
Oliver Falk
81582bcf45 Fix CI pipeline: Add missing dependencies for performance tests
- 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.
2025-10-23 18:11:55 +02:00
Oliver Falk
ac58c9f626 Add comprehensive type hints to performance tests
🔧 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.
2025-10-23 15:59:59 +02:00
Oliver Falk
202ae44346 Enhance performance tests with comprehensive improvements
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.
2025-10-23 15:26:38 +02:00
Oliver Falk
b4f224cd4d Enhance the performance tests 2025-10-22 14:00:23 +02:00
Oliver Falk
13165579e8 Add performance tests for produciton (merge latest development efforts) 2025-10-22 12:52:29 +02:00
Oliver Falk
6db3450b20 Enhance the version endpoint and fix OTEL deployment 2025-10-17 14:49:10 +02:00
Oliver Falk
780dc18fa4 File upload security (iteration 1), security enhancements and OpenTelemetry (OTEL) implementation (sending data disabled by default) 2025-10-17 11:16:48 +02:00