Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
5c10d3d
feat: enhance EmbeddingFunc with model_name support
BukeLy Nov 18, 2025
13f2440
feat: enhance BaseVectorStorage for model isolation
BukeLy Nov 18, 2025
df5aacb
feat: Qdrant model isolation and auto-migration
BukeLy Nov 19, 2025
ad68624
feat: PostgreSQL model isolation and auto-migration
BukeLy Nov 19, 2025
7dc1f83
fix: PostgreSQL read methods and delete_entity_relation bugs
BukeLy Nov 19, 2025
a0dfb47
docs: add multi-model vector storage isolation demo
BukeLy Nov 19, 2025
4c12301
fix: correct parameter passing in delete_entity_relation
BukeLy Nov 19, 2025
209dadc
ci: add feature branch testing workflow
BukeLy Nov 19, 2025
c32e6a4
test: add E2E tests with real PostgreSQL and Qdrant services
BukeLy Nov 19, 2025
d89849c
fix: E2E test fixture scope mismatch
BukeLy Nov 19, 2025
47fd7ea
fix: add required connection retry configs to E2E tests
BukeLy Nov 19, 2025
dc20615
test: refactor E2E tests using complete LightRAG instances
BukeLy Nov 19, 2025
c7e7b34
test: add Qdrant legacy migration E2E test
BukeLy Nov 19, 2025
66a0dfe
fix: resolve E2E test failures in CI
BukeLy Nov 19, 2025
722f639
fix: remove Qdrant health check in E2E workflow
BukeLy Nov 19, 2025
01bdaac
refactor: optimize batch insert handling in PGVectorStorage
BukeLy Nov 19, 2025
38f41da
fix: remove non-existent storage kwargs in E2E tests
BukeLy Nov 19, 2025
bef7577
fix: correct PostgreSQL environment variable name in E2E workflow
BukeLy Nov 19, 2025
6737ec0
fix: improve Qdrant wait strategy in E2E tests
BukeLy Nov 19, 2025
bf176b3
fix: correct attribute access in E2E tests
BukeLy Nov 19, 2025
519f7f6
fix: handle wrapped embedding_func and lock flag logic
BukeLy Nov 19, 2025
fa7a43a
fix: preserve EmbeddingFunc object in global_config
BukeLy Nov 19, 2025
5d95473
fix: correct Qdrant legacy_namespace for data migration
BukeLy Nov 19, 2025
e842327
fix: replace db.fetch with db.query for PostgreSQL migration
BukeLy Nov 19, 2025
e9f6ced
fix: use NetworkXStorage for E2E tests (AGE extension not available i…
BukeLy Nov 19, 2025
088b986
style: fix lint issues (trailing whitespace and formatting)
BukeLy Nov 19, 2025
65ff9b3
style: fix lint errors in E2E test file
BukeLy Nov 19, 2025
6bef407
style: fix lint errors (trailing whitespace and formatting)
BukeLy Nov 19, 2025
3979095
feat: implement vector storage model isolation and legacy migration
BukeLy Nov 19, 2025
df7a8f2
fix: add backward compatibility for Qdrant legacy collection detection
BukeLy Nov 19, 2025
19caf9f
test: add comprehensive E2E migration tests for Qdrant and complete u…
BukeLy Nov 19, 2025
84ff11f
fix: add safety check for empty model_suffix in PostgreSQL vector sto…
BukeLy Nov 19, 2025
42df825
fix: handle empty model_suffix in Qdrant collection naming
BukeLy Nov 19, 2025
7d0c356
fix: correct assert syntax in test_empty_model_suffix to prevent fals…
BukeLy Nov 19, 2025
982b63c
fix: correct AsyncPG parameter passing in PostgreSQL migration to pre…
BukeLy Nov 19, 2025
0508ad7
fix: prevent offline tests from failing due to missing E2E dependencies
BukeLy Nov 19, 2025
d12c149
chore: remove internal analysis document from PR
BukeLy Nov 19, 2025
8d9b6a6
fix: use actual embedding_dim instead of environment variable
BukeLy Nov 19, 2025
e24b2ed
fix: Prioritize workspace-specific legacy collections in Qdrant migra…
BukeLy Nov 19, 2025
48f6511
style: Apply ruff-format to qdrant_impl.py
BukeLy Nov 19, 2025
cedb3d4
fix: pass workspace to LightRAG instance instead of vector_db_storage…
BukeLy Nov 19, 2025
b29f32b
fix: correct PostgreSQL migration parameter passing
BukeLy Nov 19, 2025
4e86da2
fix: update PostgreSQL migration mock to match actual execute() signa…
BukeLy Nov 19, 2025
31e3ad1
refactor: remove redundant test files
BukeLy Nov 20, 2025
8386ea0
refactor: unify PostgreSQL and Qdrant migration logic for consistency
BukeLy Nov 20, 2025
c89b0ee
fix: specify conflict target in PostgreSQL ON CONFLICT clause
BukeLy Nov 20, 2025
e1e1080
test: add E2E tests for dimension mismatch scenarios
BukeLy Nov 20, 2025
e0767b1
fix: correct Qdrant point ID type in dimension mismatch E2E test
BukeLy Nov 20, 2025
5180c1e
feat: implement dimension compatibility checks for PostgreSQL and Qdr…
BukeLy Nov 20, 2025
8077c8a
style: fix lint errors in test files
BukeLy Nov 20, 2025
e89c17c
fix: restore uv.lock revision 3 and fix code formatting
BukeLy Nov 20, 2025
44e8be1
style: apply ruff formatting fixes to test_e2e_multi_instance.py
BukeLy Nov 20, 2025
f69cf9b
fix: prevent vector dimension mismatch crashes and data loss on no-su…
BukeLy Nov 23, 2025
cfc6587
fix: prevent race conditions and cross-workspace data leakage in migr…
BukeLy Nov 23, 2025
49bbb3a
test: add E2E test for workspace migration isolation
BukeLy Nov 23, 2025
204a253
fix: prevent double-release in UnifiedLock.__aexit__ error recovery
BukeLy Nov 23, 2025
16fff35
fix: prevent data loss in PostgreSQL migration and add doc_status tab…
BukeLy Nov 23, 2025
e2d68ad
style: apply ruff formatting to test files
BukeLy Nov 23, 2025
510baeb
fix: correct PostgreSQL execute() parameter format in workspace cleanup
BukeLy Nov 23, 2025
3b8a1e6
style: apply ruff formatting fixes to test files
BukeLy Nov 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
190 changes: 190 additions & 0 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
name: E2E Tests (Real Databases)

on:
workflow_dispatch: # Manual trigger only for E2E tests
pull_request:
branches: [ main, dev ]
paths:
- 'lightrag/kg/postgres_impl.py'
- 'lightrag/kg/qdrant_impl.py'
- 'tests/test_e2e_*.py'

jobs:
e2e-postgres:
name: E2E PostgreSQL Tests
runs-on: ubuntu-latest

services:
postgres:
image: ankane/pgvector:latest
env:
POSTGRES_USER: lightrag
POSTGRES_PASSWORD: lightrag_test_password
POSTGRES_DB: lightrag_test
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U lightrag"
--health-interval 10s
--health-timeout 5s
--health-retries 5

strategy:
matrix:
python-version: ['3.10', '3.12']

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Cache pip packages
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-e2e-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-e2e-
${{ runner.os }}-pip-

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[api]"
pip install pytest pytest-asyncio asyncpg numpy qdrant-client

- name: Wait for PostgreSQL
run: |
timeout 30 bash -c 'until pg_isready -h localhost -p 5432 -U lightrag; do sleep 1; done'

- name: Setup pgvector extension
env:
PGPASSWORD: lightrag_test_password
run: |
psql -h localhost -U lightrag -d lightrag_test -c "CREATE EXTENSION IF NOT EXISTS vector;"
psql -h localhost -U lightrag -d lightrag_test -c "SELECT extname, extversion FROM pg_extension WHERE extname = 'vector';"

- name: Run PostgreSQL E2E tests
env:
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432
POSTGRES_USER: lightrag
POSTGRES_PASSWORD: lightrag_test_password
POSTGRES_DATABASE: lightrag_test
run: |
pytest tests/test_e2e_multi_instance.py -k "postgres" -v --tb=short -s
timeout-minutes: 20

- name: Upload PostgreSQL test results
if: always()
uses: actions/upload-artifact@v4
with:
name: e2e-postgres-results-py${{ matrix.python-version }}
path: |
.pytest_cache/
test-results.xml
retention-days: 7

e2e-qdrant:
name: E2E Qdrant Tests
runs-on: ubuntu-latest

services:
qdrant:
image: qdrant/qdrant:latest
ports:
- 6333:6333
- 6334:6334

strategy:
matrix:
python-version: ['3.10', '3.12']

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Cache pip packages
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-e2e-${{ hashFiles('**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-e2e-
${{ runner.os }}-pip-

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[api]"
pip install pytest pytest-asyncio qdrant-client numpy

- name: Wait for Qdrant
run: |
echo "Waiting for Qdrant to be ready..."
for i in {1..60}; do
if curl -s http://localhost:6333 > /dev/null 2>&1; then
echo "Qdrant is ready!"
break
fi
echo "Attempt $i/60: Qdrant not ready yet, waiting..."
sleep 1
done
# Final check
if ! curl -s http://localhost:6333 > /dev/null 2>&1; then
echo "ERROR: Qdrant failed to start after 60 seconds"
exit 1
fi

- name: Verify Qdrant connection
run: |
echo "Verifying Qdrant API..."
curl -X GET "http://localhost:6333/collections" -H "Content-Type: application/json"
echo ""
echo "Qdrant is accessible and ready for testing"

- name: Run Qdrant E2E tests
env:
QDRANT_URL: http://localhost:6333
QDRANT_API_KEY: ""
run: |
pytest tests/test_e2e_multi_instance.py -k "qdrant" -v --tb=short -s
timeout-minutes: 15

- name: Upload Qdrant test results
if: always()
uses: actions/upload-artifact@v4
with:
name: e2e-qdrant-results-py${{ matrix.python-version }}
path: |
.pytest_cache/
test-results.xml
retention-days: 7

e2e-summary:
name: E2E Test Summary
runs-on: ubuntu-latest
needs: [e2e-postgres, e2e-qdrant]
if: always()

steps:
- name: Check test results
run: |
echo "## E2E Test Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### PostgreSQL E2E Tests" >> $GITHUB_STEP_SUMMARY
echo "Status: ${{ needs.e2e-postgres.result }}" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
echo "### Qdrant E2E Tests" >> $GITHUB_STEP_SUMMARY
echo "Status: ${{ needs.e2e-qdrant.result }}" >> $GITHUB_STEP_SUMMARY

- name: Fail if any test failed
if: needs.e2e-postgres.result != 'success' || needs.e2e-qdrant.result != 'success'
run: exit 1
74 changes: 74 additions & 0 deletions .github/workflows/feature-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Feature Branch Tests

on:
workflow_dispatch: # Allow manual trigger
push:
branches:
- 'feature/**'
pull_request:
branches: [ main, dev ]

jobs:
migration-tests:
name: Vector Storage Migration Tests
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Cache pip packages
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements*.txt', '**/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[api]"
pip install pytest pytest-asyncio
- name: Run Qdrant migration tests
run: |
pytest tests/test_qdrant_migration.py -v --tb=short
continue-on-error: false

- name: Run PostgreSQL migration tests
run: |
pytest tests/test_postgres_migration.py -v --tb=short
continue-on-error: false

- name: Run all unit tests (if exists)
run: |
# Run EmbeddingFunc tests
pytest tests/ -k "embedding" -v --tb=short || true
continue-on-error: true

- name: Upload test results
if: always()
uses: actions/upload-artifact@v4
with:
name: migration-test-results-py${{ matrix.python-version }}
path: |
.pytest_cache/
test-results.xml
retention-days: 7

- name: Test Summary
if: always()
run: |
echo "## Test Summary" >> $GITHUB_STEP_SUMMARY
echo "- Python: ${{ matrix.python-version }}" >> $GITHUB_STEP_SUMMARY
echo "- Branch: ${{ github.ref_name }}" >> $GITHUB_STEP_SUMMARY
echo "- Commit: ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY
Loading
Loading