LightRAG/.github
BukeLy c32e6a4e7b test: add E2E tests with real PostgreSQL and Qdrant services
Why this change is needed:
While unit tests with mocks verify code logic, they cannot catch real-world
issues like database connectivity, SQL syntax errors, vector dimension mismatches,
or actual data migration failures. E2E tests with real database services provide
confidence that the feature works in production-like environments.

What this adds:
1. E2E workflow (.github/workflows/e2e-tests.yml):
   - PostgreSQL job with ankane/pgvector:latest service
   - Qdrant job with qdrant/qdrant:latest service
   - Runs on Python 3.10 and 3.12
   - Manual trigger + automatic on PR

2. PostgreSQL E2E tests (test_e2e_postgres_migration.py):
   - Fresh installation: Create new table with model suffix
   - Legacy migration: Migrate 10 real records from legacy table
   - Multi-model: Two models create separate tables with different dimensions
   - Tests real SQL execution, pgvector operations, data integrity

3. Qdrant E2E tests (test_e2e_qdrant_migration.py):
   - Fresh installation: Create new collection with model suffix
   - Legacy migration: Migrate 10 real vectors from legacy collection
   - Multi-model: Two models create separate collections (768d vs 1024d)
   - Tests real Qdrant API calls, collection creation, vector operations

How it solves it:
- Uses GitHub Actions services to spin up real databases
- Tests connect to actual PostgreSQL with pgvector extension
- Tests connect to actual Qdrant server with HTTP API
- Verifies complete data flow: create → migrate → verify
- Validates dimension isolation and data integrity

Impact:
- Catches database-specific issues before production
- Validates migration logic with real data
- Confirms multi-model isolation works end-to-end
- Provides high confidence for merge to main

Testing:
After this commit, E2E tests can be triggered manually from GitHub Actions UI:
  Actions → E2E Tests (Real Databases) → Run workflow

Expected results:
- PostgreSQL E2E: 3 tests pass (fresh install, migration, multi-model)
- Qdrant E2E: 3 tests pass (fresh install, migration, multi-model)
- Total: 6 E2E tests validating real database operations

Note:
E2E tests are separate from fast unit tests and only run on:
1. Manual trigger (workflow_dispatch)
2. Pull requests that modify storage implementation files
This keeps the main CI fast while providing thorough validation when needed.
2025-11-19 23:41:40 +08:00
..
ISSUE_TEMPLATE Remove <title> from issue template 2025-04-18 15:31:34 +08:00
workflows test: add E2E tests with real PostgreSQL and Qdrant services 2025-11-19 23:41:40 +08:00
pull_request_template.md