Commit graph

4 commits

Author SHA1 Message Date
BukeLy
bf176b38ee fix: correct attribute access in E2E tests
Why this change is needed:
Tests were accessing rag.chunk_entity_relation_graph.chunk_vdb which
doesn't exist. The chunk_entity_relation_graph is a BaseGraphStorage
and doesn't have a chunk_vdb attribute.

How it solves it:
Changed all occurrences to use direct LightRAG attributes:
- rag.chunks_vdb.table_name (PostgreSQL)
- rag.chunks_vdb.final_namespace (Qdrant)

Impact:
Fixes AttributeError that would occur when E2E tests run

Testing:
Will verify on GitHub Actions E2E test run
2025-11-20 00:47:16 +08:00
BukeLy
38f41daa3d fix: remove non-existent storage kwargs in E2E tests
Why this change is needed:
E2E tests were failing with TypeError because they used non-existent
parameters kv_storage_cls_kwargs, graph_storage_cls_kwargs, and
doc_status_storage_cls_kwargs. These parameters do not exist in
LightRAG's __init__ method.

How it solves it:
Removed the three non-existent parameters from all LightRAG initializations
in test_e2e_multi_instance.py:
- test_legacy_migration_postgres
- test_multi_instance_postgres (both instances A and B)

PostgreSQL storage classes (PGKVStorage, PGGraphStorage, PGDocStatusStorage)
use ClientManager which reads configuration from environment variables
(POSTGRES_HOST, POSTGRES_PORT, etc.) that are already set in the E2E
workflow, so no additional kwargs are needed.

Impact:
- Fixes TypeError on LightRAG initialization
- E2E tests can now properly instantiate with PostgreSQL storages
- Configuration still works via environment variables

Testing:
Next E2E run should successfully initialize LightRAG instances
and proceed to actual migration/multi-instance testing.
2025-11-20 00:32:16 +08:00
BukeLy
c7e7b347e9 test: add Qdrant legacy migration E2E test
Why this change is needed:
Complete E2E test coverage for vector model isolation feature requires
testing legacy data migration for both PostgreSQL and Qdrant backends.
Previously only PostgreSQL migration was tested.

How it solves it:
- Add test_legacy_migration_qdrant() function to test automatic migration
  from legacy collection (no model suffix) to model-suffixed collection
- Test creates legacy "lightrag_vdb_chunks" collection with 1536d vectors
- Initializes LightRAG with model_name="text-embedding-ada-002"
- Verifies automatic migration to "lightrag_vdb_chunks_text_embedding_ada_002_1536d"
- Validates vector count, dimension, and collection existence

Impact:
- Ensures Qdrant migration works correctly in real scenarios
- Provides parity with PostgreSQL E2E test coverage
- Will be automatically run in CI via -k "qdrant" filter

Testing:
- Test follows same pattern as test_legacy_migration_postgres
- Uses complete LightRAG initialization with mock LLM and embedding
- Includes proper cleanup via qdrant_cleanup fixture
- Syntax validated with python3 -m py_compile
2025-11-20 00:19:21 +08:00
BukeLy
dc2061583f test: refactor E2E tests using complete LightRAG instances
Replaced storage-level E2E tests with comprehensive LightRAG-based tests.

Key improvements:
- Use complete LightRAG initialization (not just storage classes)
- Proper mock LLM/embedding functions matching real usage patterns
- Added tokenizer support for realistic testing

Test coverage:
1. test_legacy_migration_postgres: Automatic migration from legacy table (1536d)
2. test_multi_instance_postgres: Multiple LightRAG instances (768d + 1024d)
3. test_multi_instance_qdrant: Multiple Qdrant instances (768d + 1024d)

Scenarios tested:
- ✓ Multi-dimension support (768d, 1024d, 1536d)
- ✓ Multi-model names (model-a, model-b, text-embedding-ada-002)
- ✓ Legacy migration (backward compatibility)
- ✓ Multi-instance coexistence
- ✓ PostgreSQL and Qdrant storage backends

Removed:
- tests/test_e2e_postgres_migration.py (replaced)
- tests/test_e2e_qdrant_migration.py (replaced)

Updated:
- .github/workflows/e2e-tests.yml: Use unified test file
2025-11-20 00:13:00 +08:00