Why this change is needed: The previous test coverage had gaps in critical migration scenarios that could lead to data loss or broken upgrades for users migrating from old versions of LightRAG. What was added: 1. E2E Tests (test_e2e_multi_instance.py): - test_case1_both_exist_warning_qdrant: Verify warning when both collections exist - test_case2_only_new_exists_qdrant: Verify existing collection reuse - test_backward_compat_old_workspace_naming_qdrant: Test old workspace naming migration - test_empty_legacy_qdrant: Verify empty legacy collection handling - test_workspace_isolation_e2e_qdrant: Validate workspace data isolation 2. Unit Tests (test_migration_complete.py): - All 4 migration cases (new+legacy, only new, only legacy, neither) - Backward compatibility tests for multiple legacy naming patterns - Empty legacy migration scenario - Workspace isolation verification - Model switching scenario - Full migration lifecycle integration test How it solves it: These tests validate the _find_legacy_collection() backward compatibility fix with real Qdrant database instances, ensuring smooth upgrades from all legacy versions. Impact: - Prevents regressions in migration logic - Validates backward compatibility with old naming schemes - Ensures workspace isolation works correctly - Will run in CI pipeline to catch issues early Testing: All 20+ tests pass locally. E2E tests will validate against real Qdrant in CI. |
||
|---|---|---|
| .. | ||
| conftest.py | ||
| README_WORKSPACE_ISOLATION_TESTS.md | ||
| test_aquery_data_endpoint.py | ||
| test_base_storage_integrity.py | ||
| test_curl_aquery_data.sh | ||
| test_e2e_multi_instance.py | ||
| test_embedding_func.py | ||
| test_graph_storage.py | ||
| test_lightrag_ollama_chat.py | ||
| test_migration_complete.py | ||
| test_postgres_migration.py | ||
| test_postgres_retry_integration.py | ||
| test_qdrant_migration.py | ||
| test_workspace_isolation.py | ||
| test_write_json_optimization.py | ||