~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.
Python academiaanthropicarxivbravedeep-researchencryptionhome-automationhomeserverlocallocal-deep-researchlocal-llmmistralollamaopenaipubmedresearchresearch-toolretrieval-augmented-generationsearxngself-hosted
perf: speed up CI with Docker layer caching and parallel tests (#1247)
LearningCircuita5bde59b2831
diff --git a/.github/workflows/enhanced-tests.yml b/.github/workflows/enhanced-tests.ymlindex 8ce52915af..80bee5247c 100644--- a/.github/workflows/enhanced-tests.yml+++ b/.github/workflows/enhanced-tests.yml@@ -26,8 +26,18 @@ jobs:steps:- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0- - name: Build Docker image- run: docker build --target ldr-test -t ldr-test .+ - name: Set up Docker Buildx+ uses: docker/setup-buildx-action@v3++ - name: Build Docker image with cache+ uses: docker/build-push-action@v6+ with:+ context: .+ target: ldr-test+ load: true+ tags: ldr-test+ cache-from: type=gha+ cache-to: type=gha,mode=max- name: Run enhanced test framework testsrun: |@@ -37,7 +47,7 @@ jobs:-e CI=true \-w /app \ldr-test \- sh -c "python -m pytest -v \+ sh -c "python -m pytest -v -n auto \tests/test_wikipedia_url_security.py \tests/test_search_engines_enhanced.py \tests/test_utils.py \diff --git a/.github/workflows/library-tests.yml b/.github/workflows/library-tests.ymlindex 83832be07c..fb9dd6e2f1 100644--- a/.github/workflows/library-tests.yml+++ b/.github/workflows/library-tests.yml@@ -42,8 +42,18 @@ jobs:steps:- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0- - name: Build Docker image- run: docker build --target ldr-test -t ldr-test .+ - name: Set up Docker Buildx+ uses: docker/setup-buildx-action@v3++ - name: Build Docker image with cache+ uses: docker/build-push-action@v6+ with:+ context: .+ target: ldr-test+ load: true+ tags: ldr-test+ cache-from: type=gha+ cache-to: type=gha,mode=max- name: Run security unit testsrun: |@@ -54,7 +64,7 @@ jobs:-e CI=true \-w /app \ldr-test \- sh -c "python -m pytest tests/security/ -v --tb=short"+ sh -c "python -m pytest tests/security/ -v --tb=short -n auto"# LLM provider testsllm-provider-tests:@@ -65,8 +75,18 @@ jobs:steps:- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0- - name: Build Docker image- run: docker build --target ldr-test -t ldr-test .+ - name: Set up Docker Buildx+ uses: docker/setup-buildx-action@v3++ - name: Build Docker image with cache+ uses: docker/build-push-action@v6+ with:+ context: .+ target: ldr-test+ load: true+ tags: ldr-test+ cache-from: type=gha+ cache-to: type=gha,mode=max- name: Run LLM provider testsrun: |@@ -77,7 +97,7 @@ jobs:-e CI=true \-w /app \ldr-test \- sh -c "python -m pytest tests/llm_providers/ -v --tb=short"+ sh -c "python -m pytest tests/llm_providers/ -v --tb=short -n auto"# Embeddings provider testsembeddings-tests:@@ -88,8 +108,18 @@ jobs:steps:- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0- - name: Build Docker image- run: docker build --target ldr-test -t ldr-test .+ - name: Set up Docker Buildx+ uses: docker/setup-buildx-action@v3++ - name: Build Docker image with cache+ uses: docker/build-push-action@v6+ with:+ context: .+ target: ldr-test+ load: true+ tags: ldr-test+ cache-from: type=gha+ cache-to: type=gha,mode=max- name: Run embeddings provider testsrun: |@@ -100,7 +130,7 @@ jobs:-e CI=true \-w /app \ldr-test \- sh -c "python -m pytest tests/embeddings/ -v --tb=short"+ sh -c "python -m pytest tests/embeddings/ -v --tb=short -n auto"# Search engine testssearch-engine-tests:@@ -111,8 +141,18 @@ jobs:steps:- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0- - name: Build Docker image- run: docker build --target ldr-test -t ldr-test .+ - name: Set up Docker Buildx+ uses: docker/setup-buildx-action@v3++ - name: Build Docker image with cache+ uses: docker/build-push-action@v6+ with:+ context: .+ target: ldr-test+ load: true+ tags: ldr-test+ cache-from: type=gha+ cache-to: type=gha,mode=max- name: Run search engine testsrun: |@@ -123,7 +163,7 @@ jobs:-e CI=true \-w /app \ldr-test \- sh -c "python -m pytest tests/search_engines/ -v --tb=short"+ sh -c "python -m pytest tests/search_engines/ -v --tb=short -n auto"# Research library downloader testslibrary-downloader-tests:@@ -134,8 +174,18 @@ jobs:steps:- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0- - name: Build Docker image- run: docker build --target ldr-test -t ldr-test .+ - name: Set up Docker Buildx+ uses: docker/setup-buildx-action@v3++ - name: Build Docker image with cache+ uses: docker/build-push-action@v6+ with:+ context: .+ target: ldr-test+ load: true+ tags: ldr-test+ cache-from: type=gha+ cache-to: type=gha,mode=max- name: Run research library downloader testsrun: |@@ -146,7 +196,7 @@ jobs:-e CI=true \-w /app \ldr-test \- sh -c "python -m pytest tests/research_library/downloaders/ -v --tb=short"+ sh -c "python -m pytest tests/research_library/downloaders/ -v --tb=short -n auto"# Research library service testslibrary-service-tests:@@ -158,8 +208,18 @@ jobs:steps:- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0- - name: Build Docker image- run: docker build --target ldr-test -t ldr-test .+ - name: Set up Docker Buildx+ uses: docker/setup-buildx-action@v3++ - name: Build Docker image with cache+ uses: docker/build-push-action@v6+ with:+ context: .+ target: ldr-test+ load: true+ tags: ldr-test+ cache-from: type=gha+ cache-to: type=gha,mode=max- name: Run library service testsrun: |@@ -170,7 +230,7 @@ jobs:-e CI=true \-w /app \ldr-test \- sh -c "python -m pytest tests/research_library/services/ -v --tb=short"+ sh -c "python -m pytest tests/research_library/services/ -v --tb=short -n auto"# Collections API testscollections-api-tests:@@ -183,8 +243,18 @@ jobs:steps:- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0- - name: Build Docker image- run: docker build --target ldr-test -t ldr-test .+ - name: Set up Docker Buildx+ uses: docker/setup-buildx-action@v3++ - name: Build Docker image with cache+ uses: docker/build-push-action@v6+ with:+ context: .+ target: ldr-test+ load: true+ tags: ldr-test+ cache-from: type=gha+ cache-to: type=gha,mode=max- name: Run collections API testsrun: |@@ -195,7 +265,7 @@ jobs:-e CI=true \-w /app \ldr-test \- sh -c "python -m pytest tests/api_tests/test_collections_api.py -v --tb=short"+ sh -c "python -m pytest tests/api_tests/test_collections_api.py -v --tb=short -n auto"# Library UI tests - Run natively on ubuntu-latest for proper browser supportlibrary-ui-tests:diff --git a/.github/workflows/llm-tests.yml b/.github/workflows/llm-tests.ymlindex 9cebb99ad3..3420f58594 100644--- a/.github/workflows/llm-tests.yml+++ b/.github/workflows/llm-tests.yml@@ -30,8 +30,18 @@ jobs:steps:- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0- - name: Build Docker image- run: docker build --target ldr-test -t ldr-test .+ - name: Set up Docker Buildx+ uses: docker/setup-buildx-action@v3++ - name: Build Docker image with cache+ uses: docker/build-push-action@v6+ with:+ context: .+ target: ldr-test+ load: true+ tags: ldr-test+ cache-from: type=gha+ cache-to: type=gha,mode=max- name: Run LLM registry testsrun: |@@ -40,7 +50,7 @@ jobs:-e PYTHONPATH=/app \-w /app \ldr-test \- sh -c "python -m pytest tests/test_llm/test_llm_registry.py -v"+ sh -c "python -m pytest tests/test_llm/test_llm_registry.py -v -n auto"- name: Run LLM integration testsrun: |@@ -50,7 +60,7 @@ jobs:-e LDR_USE_FALLBACK_LLM=true \-w /app \ldr-test \- sh -c "python -m pytest tests/test_llm/test_llm_integration.py -v"+ sh -c "python -m pytest tests/test_llm/test_llm_integration.py -v -n auto"- name: Run API LLM integration testsrun: |@@ -60,7 +70,7 @@ jobs:-e LDR_USE_FALLBACK_LLM=true \-w /app \ldr-test \- sh -c "python -m pytest tests/test_llm/test_api_llm_integration.py -v"+ sh -c "python -m pytest tests/test_llm/test_api_llm_integration.py -v -n auto"- name: Run LLM edge case testsrun: |@@ -69,7 +79,7 @@ jobs:-e PYTHONPATH=/app \-w /app \ldr-test \- sh -c "python -m pytest tests/test_llm/test_llm_edge_cases.py -v"+ sh -c "python -m pytest tests/test_llm/test_llm_edge_cases.py -v -n auto"- name: Run LLM benchmark testsrun: |@@ -78,7 +88,7 @@ jobs:-e PYTHONPATH=/app \-w /app \ldr-test \- sh -c "python -m pytest tests/test_llm/test_llm_benchmarks.py -v"+ sh -c "python -m pytest tests/test_llm/test_llm_benchmarks.py -v -n auto"llm-example-tests:runs-on: ubuntu-latest@@ -88,8 +98,18 @@ jobs:steps:- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0- - name: Build Docker image- run: docker build --target ldr-test -t ldr-test .+ - name: Set up Docker Buildx+ uses: docker/setup-buildx-action@v3++ - name: Build Docker image with cache+ uses: docker/build-push-action@v6+ with:+ context: .+ target: ldr-test+ load: true+ tags: ldr-test+ cache-from: type=gha+ cache-to: type=gha,mode=max- name: Test basic custom LLM examplerun: |diff --git a/.github/workflows/security-tests.yml b/.github/workflows/security-tests.ymlindex 7ef414da3d..5df2066ae0 100644--- a/.github/workflows/security-tests.yml+++ b/.github/workflows/security-tests.yml@@ -84,56 +84,56 @@ jobs:DATABASE_URL: postgresql://postgres:postgres@localhost:5432/test_security_dbrun: |# Run SQL injection specific tests- pdm run python -m pytest tests/security/test_sql_injection.py -v --tb=short+ pdm run python -m pytest tests/security/test_sql_injection.py -v --tb=short -n auto# Legacy tests (if they exist)if [ -f tests/test_sql_injection_prevention.py ]; then- pdm run python -m pytest tests/test_sql_injection_prevention.py -v --tb=short+ pdm run python -m pytest tests/test_sql_injection_prevention.py -v --tb=short -n autofi- name: Run XSS prevention testsrun: |- pdm run python -m pytest tests/security/test_xss_prevention.py -v --tb=short+ pdm run python -m pytest tests/security/test_xss_prevention.py -v --tb=short -n auto# Legacy tests (if they exist)if [ -f tests/test_xss_prevention.py ]; then- pdm run python -m pytest tests/test_xss_prevention.py -v --tb=short+ pdm run python -m pytest tests/test_xss_prevention.py -v --tb=short -n autofi- name: Run CSRF protection testsrun: |- pdm run python -m pytest tests/security/test_csrf_protection.py -v --tb=short+ pdm run python -m pytest tests/security/test_csrf_protection.py -v --tb=short -n auto# Legacy tests (if they exist)if [ -f tests/test_csrf_protection.py ]; then- pdm run python -m pytest tests/test_csrf_protection.py -v --tb=short+ pdm run python -m pytest tests/test_csrf_protection.py -v --tb=short -n autofi- name: Run authentication security testsrun: |- pdm run python -m pytest tests/security/test_auth_security.py -v --tb=short+ pdm run python -m pytest tests/security/test_auth_security.py -v --tb=short -n auto# Legacy tests (if they exist)if [ -f tests/test_password_security.py ]; then- pdm run python -m pytest tests/test_password_security.py -v --tb=short+ pdm run python -m pytest tests/test_password_security.py -v --tb=short -n autofiif [ -f tests/test_session_security.py ]; then- pdm run python -m pytest tests/test_session_security.py -v --tb=short+ pdm run python -m pytest tests/test_session_security.py -v --tb=short -n autofi- name: Run API security testsrun: |- pdm run python -m pytest tests/security/test_api_security.py -v --tb=short+ pdm run python -m pytest tests/security/test_api_security.py -v --tb=short -n auto# Legacy tests (if they exist)if [ -f tests/test_rate_limiting.py ]; then- pdm run python -m pytest tests/test_rate_limiting.py -v --tb=short+ pdm run python -m pytest tests/test_rate_limiting.py -v --tb=short -n autofiif [ -f tests/test_api_authentication.py ]; then- pdm run python -m pytest tests/test_api_authentication.py -v --tb=short+ pdm run python -m pytest tests/test_api_authentication.py -v --tb=short -n autofi- name: Run input validation testsrun: |- pdm run python -m pytest tests/security/test_input_validation.py -v --tb=short+ pdm run python -m pytest tests/security/test_input_validation.py -v --tb=short -n auto# Legacy tests (if they exist)if [ -f tests/test_input_sanitization.py ]; then- pdm run python -m pytest tests/test_input_sanitization.py -v --tb=short+ pdm run python -m pytest tests/test_input_sanitization.py -v --tb=short -n autofi- name: Check for hardcoded secretsdiff --git a/.github/workflows/tests.yml b/.github/workflows/tests.ymlindex 182183bf22..f8d94b9f0f 100644--- a/.github/workflows/tests.yml+++ b/.github/workflows/tests.yml@@ -20,8 +20,18 @@ jobs:steps:- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0- - name: Build Docker image- run: docker build --target ldr-test -t ldr-test .+ - name: Set up Docker Buildx+ uses: docker/setup-buildx-action@v3++ - name: Build Docker image with cache+ uses: docker/build-push-action@v6+ with:+ context: .+ target: ldr-test+ load: true+ tags: ldr-test+ cache-from: type=gha+ cache-to: type=gha,mode=max- name: Set up Node.jsuses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6@@ -65,8 +75,18 @@ jobs:steps:- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0- - name: Build Docker image- run: docker build --target ldr-test -t ldr-test .+ - name: Set up Docker Buildx+ uses: docker/setup-buildx-action@v3++ - name: Build Docker image with cache+ uses: docker/build-push-action@v6+ with:+ context: .+ target: ldr-test+ load: true+ tags: ldr-test+ cache-from: type=gha+ cache-to: type=gha,mode=max- name: Set up Node.jsuses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6@@ -83,7 +103,7 @@ jobs:-v "$PWD":/app \-w /app \ldr-test \- sh -c "pytest tests/infrastructure_tests/test_*.py -v"+ sh -c "pytest tests/infrastructure_tests/test_*.py -v -n auto"- name: Run JavaScript infrastructure testsrun: |@@ -99,8 +119,18 @@ jobs:steps:- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0- - name: Build Docker image- run: docker build --target ldr-test -t ldr-test .+ - name: Set up Docker Buildx+ uses: docker/setup-buildx-action@v3++ - name: Build Docker image with cache+ uses: docker/build-push-action@v6+ with:+ context: .+ target: ldr-test+ load: true+ tags: ldr-test+ cache-from: type=gha+ cache-to: type=gha,mode=max- name: Run CI test profilerun: |@@ -125,8 +155,18 @@ jobs:steps:- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0- - name: Build Docker image- run: docker build --target ldr-test -t ldr-test .+ - name: Set up Docker Buildx+ uses: docker/setup-buildx-action@v3++ - name: Build Docker image with cache+ uses: docker/build-push-action@v6+ with:+ context: .+ target: ldr-test+ load: true+ tags: ldr-test+ cache-from: type=gha+ cache-to: type=gha,mode=max- name: Run text optimization testsrun: |@@ -136,7 +176,7 @@ jobs:-e LDR_TESTING_WITH_MOCKS=true \-w /app \ldr-test \- sh -c "python -m pytest tests/text_optimization/ -v"+ sh -c "python -m pytest tests/text_optimization/ -v -n auto"# Extended pytest tests (beyond unit tests)extended-pytest-tests:@@ -151,8 +191,18 @@ jobs:steps:- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0- - name: Build Docker image- run: docker build --target ldr-test -t ldr-test .+ - name: Set up Docker Buildx+ uses: docker/setup-buildx-action@v3++ - name: Build Docker image with cache+ uses: docker/build-push-action@v6+ with:+ context: .+ target: ldr-test+ load: true+ tags: ldr-test+ cache-from: type=gha+ cache-to: type=gha,mode=max- name: Run extended pytest suiterun: |@@ -170,6 +220,7 @@ jobs:--cov-report=term \--tb=short \--durations=10 \+ -n auto \tests/searxng/"# UI tests@@ -185,8 +236,18 @@ jobs:steps:- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0- - name: Build Docker image- run: docker build --target ldr-test -t ldr-test .+ - name: Set up Docker Buildx+ uses: docker/setup-buildx-action@v3++ - name: Build Docker image with cache+ uses: docker/build-push-action@v6+ with:+ context: .+ target: ldr-test+ load: true+ tags: ldr-test+ cache-from: type=gha+ cache-to: type=gha,mode=max- name: Install Node.js for UI testsuses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6diff --git a/pyproject.toml b/pyproject.tomlindex 172436fd8e..d9094afad3 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -139,6 +139,7 @@ dev = ["pytest-cov~=7.0","pytest-timeout~=2.4","pytest-asyncio~=1.3",+ "pytest-xdist>=3.5","ruff~=0.14","freezegun~=1.5","mypy~=1.19",