76 lines
2.3 KiB
Markdown
76 lines
2.3 KiB
Markdown
# Test Refactoring Plan
|
|
|
|
This document outlines the steps to refactor `tests.rs` into multiple files and expand test coverage across the codebase.
|
|
|
|
## Phase 1: Refactor Existing Tests
|
|
|
|
1. **Split compression tests into separate module files**
|
|
- Files to update:
|
|
- `src/tests.rs` (remove compression_tests module)
|
|
- Files to add:
|
|
- `src/tests/compression/mod.rs`
|
|
- `src/tests/compression/gzip_tests.rs`
|
|
- `src/tests/compression/lz4_tests.rs`
|
|
- `src/tests/compression/none_tests.rs`
|
|
|
|
2. **Split compression type tests into separate module files**
|
|
- Files to update:
|
|
- `src/tests.rs` (remove compression_type_tests module)
|
|
- Files to add:
|
|
- `src/tests/compression/types/mod.rs`
|
|
- `src/tests/compression/types/factory_tests.rs`
|
|
- `src/tests/compression/types/conversion_tests.rs`
|
|
|
|
3. **Create test module structure**
|
|
- Files to add:
|
|
- `src/tests/mod.rs` (main test module file)
|
|
- `src/tests/common/mod.rs`
|
|
|
|
## Phase 2: Add Tests for Other Modules
|
|
|
|
4. **Add database tests**
|
|
- Files to add:
|
|
- `src/tests/db/mod.rs`
|
|
- `src/tests/db/item_tests.rs`
|
|
- `src/tests/db/tag_tests.rs`
|
|
- `src/tests/db/meta_tests.rs`
|
|
|
|
5. **Add meta plugin tests**
|
|
- Files to add:
|
|
- `src/tests/meta_plugin/mod.rs`
|
|
- `src/tests/meta_plugin/system_tests.rs`
|
|
- `src/tests/meta_plugin/digest_tests.rs`
|
|
- `src/tests/meta_plugin/program_tests.rs`
|
|
|
|
6. **Add compression engine tests**
|
|
- Files to add:
|
|
- `src/tests/compression_engine/mod.rs`
|
|
- `src/tests/compression_engine/program_tests.rs`
|
|
|
|
7. **Add mode tests**
|
|
- Files to add:
|
|
- `src/tests/modes/mod.rs`
|
|
- `src/tests/modes/save_tests.rs`
|
|
- `src/tests/modes/get_tests.rs`
|
|
- `src/tests/modes/list_tests.rs`
|
|
- `src/tests/modes/delete_tests.rs`
|
|
- `src/tests/modes/update_tests.rs`
|
|
- `src/tests/modes/info_tests.rs`
|
|
- `src/tests/modes/status_tests.rs`
|
|
- `src/tests/modes/diff_tests.rs`
|
|
|
|
8. **Add server tests**
|
|
- Files to add:
|
|
- `src/tests/server/mod.rs`
|
|
- `src/tests/server/api_tests.rs`
|
|
- `src/tests/server/auth_tests.rs`
|
|
|
|
9. **Add utility tests**
|
|
- Files to add:
|
|
- `src/tests/common/is_binary_tests.rs`
|
|
- `src/tests/common/status_tests.rs`
|
|
|
|
10. **Update main test module**
|
|
- Files to update:
|
|
- `src/tests/mod.rs` (add all test module declarations)
|