Provides: - Quick reference for common test commands - Table of runner shortcuts - Coverage instructions - What's tested checklist - Debugging tips - Test statistics
100 lines
2.2 KiB
Markdown
100 lines
2.2 KiB
Markdown
# Quick Test Guide
|
|
|
|
Quick reference for running tests in the vgui-cicd project.
|
|
|
|
## 🚀 Quick Start
|
|
|
|
```bash
|
|
# Run all tests
|
|
python manage.py test
|
|
|
|
# Or use the convenient runner
|
|
python run_tests.py all
|
|
```
|
|
|
|
## 📋 Common Commands
|
|
|
|
| Command | Description |
|
|
|---------|-------------|
|
|
| `python run_tests.py all` | Run all tests with verbose output |
|
|
| `python run_tests.py cache` | Run diagram cache tests only |
|
|
| `python run_tests.py render` | Run rendering tests only |
|
|
| `python run_tests.py commands` | Run management command tests |
|
|
| `python run_tests.py coverage` | Run tests with coverage report |
|
|
| `python run_tests.py fast` | Run with fail-fast (stops at first failure) |
|
|
|
|
## 🎯 Run Specific Tests
|
|
|
|
```bash
|
|
# Test a specific module
|
|
python manage.py test diagramm_proxy
|
|
|
|
# Test a specific test case
|
|
python manage.py test abschnitte.tests.RenderTextabschnitteTestCase
|
|
|
|
# Test a specific method
|
|
python manage.py test abschnitte.tests.RenderTextabschnitteTestCase.test_render_diagram_success
|
|
```
|
|
|
|
## 📊 Coverage Report
|
|
|
|
```bash
|
|
# Generate coverage report
|
|
python run_tests.py coverage
|
|
|
|
# Or manually
|
|
pip install coverage
|
|
coverage run --source='.' manage.py test
|
|
coverage report
|
|
coverage html # Creates htmlcov/index.html
|
|
```
|
|
|
|
## ✅ What's Tested
|
|
|
|
### Diagram Caching (`diagramm_proxy/test_diagram_cache.py`)
|
|
- Hash computation ✓
|
|
- Cache hit/miss ✓
|
|
- HTTP errors ✓
|
|
- Cache clearing ✓
|
|
- Unicode support ✓
|
|
|
|
### Rendering (`abschnitte/tests.py`)
|
|
- Markdown to HTML ✓
|
|
- Lists (ordered/unordered) ✓
|
|
- Tables ✓
|
|
- Diagrams ✓
|
|
- Code blocks ✓
|
|
|
|
### Management Commands (`abschnitte/management/commands/test_clear_diagram_cache.py`)
|
|
- Clear all cache ✓
|
|
- Clear by type ✓
|
|
- Help text ✓
|
|
|
|
## 🐛 Debugging Failed Tests
|
|
|
|
```bash
|
|
# Run with more detail
|
|
python manage.py test --verbosity=2
|
|
|
|
# Stop at first failure
|
|
python manage.py test --failfast
|
|
|
|
# Keep test database
|
|
python manage.py test --keepdb
|
|
```
|
|
|
|
## 📖 More Information
|
|
|
|
See `Documentation/TESTING.md` for complete documentation.
|
|
|
|
## 🎓 Test Statistics
|
|
|
|
- **Total Test Files**: 3
|
|
- **Total Test Cases**: 29+
|
|
- **Lines of Test Code**: 790+
|
|
- **Coverage Target**: >80%
|
|
|
|
---
|
|
|
|
**Need help?** Check the full testing guide in `Documentation/TESTING.md`
|