Add quick test runner and enhance run_tests script
Some checks failed
Build and Push Docker Image / build-and-push (push) Has been cancelled
Some checks failed
Build and Push Docker Image / build-and-push (push) Has been cancelled
- Introduced `quick_test.py` for running specific test categories (unit, integration, theme, all). - Updated `run_tests.py` to improve test execution and reporting, including coverage. - Removed outdated test scripts for keyboard shortcuts, menu theming, note saving, and entry updating. - Added new test script `test_theme_changing.py` to verify theme changing functionality. - Consolidated integration tests into `test_integration.py` for comprehensive testing of TheChart application. - Updated theme manager to ensure color retrieval works correctly. - Modified test constants to import from the correct module path.
This commit is contained in:
58
scripts/TESTING_MIGRATION.md
Normal file
58
scripts/TESTING_MIGRATION.md
Normal file
@@ -0,0 +1,58 @@
|
||||
# Test Scripts Migration Notice
|
||||
|
||||
## ⚠️ Important: Test Structure Changed
|
||||
|
||||
The individual test scripts in this directory have been **consolidated** into a unified test suite.
|
||||
|
||||
### Old Structure (Deprecated)
|
||||
- `test_note_saving.py`
|
||||
- `test_update_entry.py`
|
||||
- `test_keyboard_shortcuts.py`
|
||||
- `test_theme_changing.py`
|
||||
- `test_menu_theming.py`
|
||||
|
||||
### New Structure (Current)
|
||||
All functionality is now in:
|
||||
- `tests/test_integration.py` - Comprehensive integration tests
|
||||
- `tests/test_*.py` - Unit tests for specific modules
|
||||
- `scripts/run_tests.py` - Main test runner
|
||||
- `scripts/quick_test.py` - Quick test runner for specific categories
|
||||
|
||||
### How to Run Tests
|
||||
|
||||
#### Run All Tests
|
||||
```bash
|
||||
cd /home/will/Code/thechart
|
||||
.venv/bin/python scripts/run_tests.py
|
||||
```
|
||||
|
||||
#### Run Specific Test Categories
|
||||
```bash
|
||||
# Unit tests only
|
||||
.venv/bin/python scripts/quick_test.py unit
|
||||
|
||||
# Integration tests only
|
||||
.venv/bin/python scripts/quick_test.py integration
|
||||
|
||||
# Theme-related tests only
|
||||
.venv/bin/python scripts/quick_test.py theme
|
||||
```
|
||||
|
||||
#### Run Individual Test Classes
|
||||
```bash
|
||||
# Run specific integration test
|
||||
.venv/bin/python -m pytest tests/test_integration.py::TestIntegrationSuite::test_theme_changing_functionality -v
|
||||
|
||||
# Run all theme manager tests
|
||||
.venv/bin/python -m pytest tests/test_theme_manager.py -v
|
||||
```
|
||||
|
||||
### Migration Benefits
|
||||
1. **Unified Structure**: All tests use the same pytest framework
|
||||
2. **Better Organization**: Related tests grouped together
|
||||
3. **Improved Coverage**: Integrated coverage reporting
|
||||
4. **Faster Execution**: Optimized test setup and teardown
|
||||
5. **Better CI/CD**: Easier to integrate with automated testing
|
||||
|
||||
### Backwards Compatibility
|
||||
The old `integration_test.py` script is still available and called by the new test runner for backwards compatibility.
|
||||
Reference in New Issue
Block a user