Add test library cleanup by name and documentation
Problem: - Libraries are universal (not user-owned) and persist in database - Tests create libraries via API but don't clean them up - Libraries accumulate between test runs Solution: - Delete test libraries (names containing "test") during cleanup - Uses case-insensitive matching to catch "Test", "TEST", "test", etc. - Preserves user-created libraries without "test" in name Changes: 1. cmd/server/tests/test_helpers.go: - Added library cleanup in setupTestServer() after user cleanup - Lists all libraries and deletes those with "test" in name - Includes warning comment about naming convention 2. docs/contributing/development.md: - Added "Test Library Naming Convention" section - Documents that "test" in library names triggers deletion - Recommends alternative names for persistent test libraries Note: Users should NOT use "test" in library names if they want to keep them.
This commit is contained in:
@@ -279,6 +279,15 @@ Environment variables for testing:
|
||||
|
||||
**⚠️ WARNING**: Never enable these in production!
|
||||
|
||||
### Test Library Naming Convention
|
||||
|
||||
Integration tests automatically clean up libraries with "test" in the name (case-insensitive).
|
||||
|
||||
**⚠️ IMPORTANT**: Do not use "test" in library names if you want to keep them!
|
||||
- Libraries containing "test" (e.g., "My Test Library", "Test Library 1") will be deleted by test cleanup
|
||||
- Use names like "Development Library", "Staging Books", or "Personal" for libraries you want to keep
|
||||
- This ensures your manual test data persists between test runs
|
||||
|
||||
## 📝 Code Style Guidelines
|
||||
|
||||
### Go Code
|
||||
|
||||
Reference in New Issue
Block a user