better instruction

This commit is contained in:
Lukas 2025-10-22 07:45:38 +02:00
parent 3e50ec0149
commit 04b516a52d

View File

@ -47,6 +47,77 @@ This document lists all failed tests identified during the test run on October 1
--- ---
## 🎯 Success Criteria
1. **All tests passing:** 0 failures, 0 errors
2. **Warnings reduced:** Aim for < 50 warnings (mostly from dependencies)
3. **Code quality maintained:** No shortcuts or hacks
4. **Documentation updated:** Any behavior changes documented
5. **Git commits:** Logical, atomic commits with clear messages
---
## 📞 Escalation
If you encounter:
- Architecture issues requiring design decisions
- Tests that conflict with documented requirements
- Breaking changes needed
- Unclear requirements or expectations
**Document the issue and escalate rather than guessing.**
---
## 📚 Helpful Commands
```bash
# Run all tests
conda run -n AniWorld python -m pytest tests/ -v --tb=short
# Run specific test file
conda run -n AniWorld python -m pytest tests/unit/test_websocket_service.py -v
# Run specific test class
conda run -n AniWorld python -m pytest tests/unit/test_websocket_service.py::TestWebSocketService -v
# Run specific test
conda run -n AniWorld python -m pytest tests/unit/test_websocket_service.py::TestWebSocketService::test_broadcast_download_progress -v
# Run with extra verbosity
conda run -n AniWorld python -m pytest tests/ -vv
# Run with full traceback
conda run -n AniWorld python -m pytest tests/ -v --tb=long
# Run and stop at first failure
conda run -n AniWorld python -m pytest tests/ -v -x
# Run tests matching pattern
conda run -n AniWorld python -m pytest tests/ -v -k "auth"
# Show all print statements
conda run -n AniWorld python -m pytest tests/ -v -s
```
---
## 📖 Additional Notes
- **Document Created:** October 19, 2025
- **Last Updated:** October 20, 2025
- **Test run time:** ~8 seconds
- **Python environment:** AniWorld (conda)
- **Framework:** pytest with FastAPI TestClient
- **Initial test failures:** 200+ (many were errors)
- **Current test failures:** 51 + 1 error
- **Overall progress:** ~75% reduction in failures
**Remember:** The goal is not just to make tests pass, but to ensure the system works correctly and reliably!
---
## 🎯 Remaining Work Summary ## 🎯 Remaining Work Summary
### High Priority Issues ### High Priority Issues
@ -439,128 +510,3 @@ session.model_dump()
- [ ] Document any remaining issues - [ ] Document any remaining issues
--- ---
## 🎯 Success Criteria
1. **All tests passing:** 0 failures, 0 errors
2. **Warnings reduced:** Aim for < 50 warnings (mostly from dependencies)
3. **Code quality maintained:** No shortcuts or hacks
4. **Documentation updated:** Any behavior changes documented
5. **Git commits:** Logical, atomic commits with clear messages
---
## 📞 Escalation
If you encounter:
- Architecture issues requiring design decisions
- Tests that conflict with documented requirements
- Breaking changes needed
- Unclear requirements or expectations
**Document the issue and escalate rather than guessing.**
---
## 📚 Helpful Commands
```bash
# Run all tests
conda run -n AniWorld python -m pytest tests/ -v --tb=short
# Run specific test file
conda run -n AniWorld python -m pytest tests/unit/test_websocket_service.py -v
# Run specific test class
conda run -n AniWorld python -m pytest tests/unit/test_websocket_service.py::TestWebSocketService -v
# Run specific test
conda run -n AniWorld python -m pytest tests/unit/test_websocket_service.py::TestWebSocketService::test_broadcast_download_progress -v
# Run with extra verbosity
conda run -n AniWorld python -m pytest tests/ -vv
# Run with full traceback
conda run -n AniWorld python -m pytest tests/ -v --tb=long
# Run and stop at first failure
conda run -n AniWorld python -m pytest tests/ -v -x
# Run tests matching pattern
conda run -n AniWorld python -m pytest tests/ -v -k "auth"
# Show all print statements
conda run -n AniWorld python -m pytest tests/ -v -s
```
---
## 📖 Additional Notes
- **Document Created:** October 19, 2025
- **Last Updated:** October 20, 2025
- **Test run time:** ~8 seconds
- **Python environment:** AniWorld (conda)
- **Framework:** pytest with FastAPI TestClient
- **Initial test failures:** 200+ (many were errors)
- **Current test failures:** 51 + 1 error
- **Overall progress:** ~75% reduction in failures
**Remember:** The goal is not just to make tests pass, but to ensure the system works correctly and reliably!
---
## 🎯 Next Steps for Completion
To achieve 100% test pass rate, focus on:
1. **Frontend Integration Tests** (highest priority)
- These represent the bulk of remaining failures (28 tests)
- May indicate issues with test setup or mock configuration
- Could also reveal real integration issues
2. **Download Flow Integration** (high priority)
- 11 failures + 1 error remaining
- Core functionality that needs to work reliably
3. **Edge Case Handling** (medium priority)
- Auth edge cases (4 tests)
- WebSocket multi-room (2 tests)
- Template integration (3 tests)
4. **Deprecation Warnings** (low priority, can be batch processed)
- Replace `datetime.utcnow()` across codebase
- Update Pydantic v2 APIs
- Modernize FastAPI lifespan handling
**Estimated time to completion:** 2-4 hours of focused work
---
## ✅ Completed Work Archive
### Successfully Fixed Test Suites
1. **tests/api/test_download_endpoints.py** - 20/20 passing ✅
2. **tests/api/test_config_endpoints.py** - 10/10 passing ✅
3. **tests/unit/test_websocket_service.py** - 7/7 passing ✅
4. **tests/api/test_anime_endpoints.py** - 7/7 passing ✅
5. **tests/api/test_auth_endpoints.py** - 1/1 passing ✅
6. **tests/integration/test_auth_flow.py** - 39/43 passing (90%+) ✅
7. **tests/integration/test_websocket.py** - 46/48 passing (95%+) ✅
8. **Most unit tests** - High pass rate across the board ✅
### Key Improvements Made
- Fixed async/await patterns in integration tests
- Corrected WebSocket mock configurations
- Improved authentication flow handling
- Fixed download service initialization
- Enhanced error handling in services
- Improved test fixtures and setup/teardown
**Total tests passing: 531/583 (91.1%)**