Skip to content

~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.

Attempt number 1 at fixing docker tests.

Daniel Pettidc803d5b4334
diff --git a/.github/workflows/enhanced-tests.yml b/.github/workflows/enhanced-tests.yml
index b1835dd07d..f1983c4f50 100644
--- a/.github/workflows/enhanced-tests.yml
+++ b/.github/workflows/enhanced-tests.yml
@@ -24,7 +24,7 @@ jobs:
- uses: actions/checkout@v4
- name: Build Docker image
- run: docker build -t ldr-test .
+ run: docker build --target ldr-test -t ldr-test .
- name: Run enhanced test framework tests
run: |
@@ -34,7 +34,7 @@ jobs:
-e CI=true \
-w /app \
ldr-test \
- sh -c "pip install --target=/install/.venv/lib/python3.12/site-packages pytest pytest-mock && python -m pytest -v \
+ sh -c "python -m pytest -v \
tests/test_wikipedia_url_security.py \
tests/test_search_engines_enhanced.py \
tests/test_utils.py \
@@ -49,7 +49,7 @@ jobs:
-e CI=true \
-w /app \
ldr-test \
- sh -c 'pip install --target=/install/.venv/lib/python3.12/site-packages pytest pytest-mock && python -c "
+ sh -c 'python -c "
from tests.fixtures.search_engine_mocks import SearchEngineMocks, validate_wikipedia_url
from tests.mock_fixtures import get_mock_search_results
from tests.mock_modules import create_mock_llm_config
diff --git a/.github/workflows/infrastructure-tests.yml b/.github/workflows/infrastructure-tests.yml
index 98e0681358..1fb1f2981e 100644
--- a/.github/workflows/infrastructure-tests.yml
+++ b/.github/workflows/infrastructure-tests.yml
@@ -23,7 +23,7 @@ jobs:
- uses: actions/checkout@v4
- name: Build Docker image
- run: docker build -t ldr-test .
+ run: docker build --target ldr-test -t ldr-test .
- name: Set up Node.js
uses: actions/setup-node@v4
@@ -39,9 +39,8 @@ jobs:
docker run --rm \
-v $PWD:/app \
-w /app \
- -e PYTHONPATH=/app:/install/.venv/lib/python3.12/site-packages \
ldr-test \
- sh -c "cd /app && pip install --target=/install/.venv/lib/python3.12/site-packages pytest pytest-mock sqlalchemy && /install/.venv/bin/python -m pytest tests/infrastructure_tests/test_*.py -v --color=yes --no-header -rN"
+ sh -c "cd /app && python -m pytest tests/infrastructure_tests/test_*.py -v --color=yes --no-header -rN"
- name: Run JavaScript infrastructure tests
run: |
diff --git a/.github/workflows/llm-tests.yml b/.github/workflows/llm-tests.yml
index d3ff814cc7..28ff89f3b0 100644
--- a/.github/workflows/llm-tests.yml
+++ b/.github/workflows/llm-tests.yml
@@ -28,7 +28,7 @@ jobs:
- uses: actions/checkout@v4
- name: Build Docker image
- run: docker build -t ldr-test .
+ run: docker build --target ldr-test -t ldr-test .
- name: Run LLM registry tests
run: |
@@ -37,7 +37,7 @@ jobs:
-e PYTHONPATH=/app \
-w /app \
ldr-test \
- sh -c "pip install --target=/install/.venv/lib/python3.12/site-packages pytest && python -m pytest tests/test_llm/test_llm_registry.py -v"
+ sh -c "python -m pytest tests/test_llm/test_llm_registry.py -v"
- name: Run LLM integration tests
run: |
@@ -47,7 +47,7 @@ jobs:
-e LDR_USE_FALLBACK_LLM=true \
-w /app \
ldr-test \
- sh -c "pip install --target=/install/.venv/lib/python3.12/site-packages pytest && python -m pytest tests/test_llm/test_llm_integration.py -v"
+ sh -c "python -m pytest tests/test_llm/test_llm_integration.py -v"
- name: Run API LLM integration tests
run: |
@@ -57,7 +57,7 @@ jobs:
-e LDR_USE_FALLBACK_LLM=true \
-w /app \
ldr-test \
- sh -c "pip install --target=/install/.venv/lib/python3.12/site-packages pytest && 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"
- name: Run LLM edge case tests
run: |
@@ -66,7 +66,7 @@ jobs:
-e PYTHONPATH=/app \
-w /app \
ldr-test \
- sh -c "pip install --target=/install/.venv/lib/python3.12/site-packages pytest pytest-asyncio && 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"
- name: Run LLM benchmark tests
run: |
@@ -75,7 +75,7 @@ jobs:
-e PYTHONPATH=/app \
-w /app \
ldr-test \
- sh -c "pip install --target=/install/.venv/lib/python3.12/site-packages pytest && python -m pytest tests/test_llm/test_llm_benchmarks.py -v"
+ sh -c "python -m pytest tests/test_llm/test_llm_benchmarks.py -v"
llm-example-tests:
runs-on: ubuntu-latest
@@ -86,7 +86,7 @@ jobs:
- uses: actions/checkout@v4
- name: Build Docker image
- run: docker build -t ldr-test .
+ run: docker build --target ldr-test -t ldr-test .
- name: Test basic custom LLM example
run: |
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index 6122bf8bf4..57021911b1 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -18,7 +18,7 @@ jobs:
- uses: actions/checkout@v4
- name: Build Docker image
- run: docker build -t ldr-test .
+ run: docker build --target ldr-test -t ldr-test .
- name: Set up Node.js
uses: actions/setup-node@v4
@@ -36,7 +36,7 @@ jobs:
-e LDR_USE_FALLBACK_LLM=true \
-w /app \
ldr-test \
- sh -c "pip install --target=/install/.venv/lib/python3.12/site-packages pytest pytest-asyncio pytest-cov pytest-mock && PYTHONPATH=/app/src:$PYTHONPATH python -m pytest -v \
+ sh -c "python -m pytest -v \
tests/test_settings_manager.py \
tests/test_google_pse.py \
tests/test_wikipedia_url_security.py \
@@ -61,7 +61,7 @@ jobs:
- uses: actions/checkout@v4
- name: Build Docker image
- run: docker build -t ldr-test .
+ run: docker build --target ldr-test -t ldr-test .
- name: Set up Node.js
uses: actions/setup-node@v4
@@ -78,7 +78,7 @@ jobs:
-v $PWD:/app \
-w /app \
ldr-test \
- sh -c "pip install pytest && PYTHONPATH=/app/src:$PYTHONPATH pytest tests/infrastructure_tests/test_*.py -v"
+ sh -c "pytest tests/infrastructure_tests/test_*.py -v"
- name: Run JavaScript infrastructure tests
run: |
@@ -120,7 +120,7 @@ jobs:
- uses: actions/checkout@v4
- name: Build Docker image
- run: docker build -t ldr-test .
+ run: docker build --target ldr-test -t ldr-test .
- name: Install Node.js for UI tests
uses: actions/setup-node@v4
@@ -175,7 +175,7 @@ jobs:
--network host \
-w /app \
ldr-test \
- sh -c "/install/.venv/bin/pip install pytest playwright && cd tests && PYTHONPATH=/app/src:$PYTHONPATH /install/.venv/bin/python run_all_tests.py full"
+ sh -c "python run_all_tests.py full"
- name: Run JavaScript infrastructure tests
run: |
diff --git a/Dockerfile b/Dockerfile
index 1d76182aab..40c11a96bb 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,7 +1,7 @@
####
# Used for building the LDR service dependencies.
####
-FROM python:3.12.8-slim AS builder
+FROM python:3.12.8-slim AS builder-base
# Install system dependencies for SQLCipher
RUN apt-get update && apt-get install -y \
@@ -21,10 +21,34 @@ COPY src/ src
COPY LICENSE LICENSE
COPY README.md README.md
+####
+# Builds the LDR service dependencies used in production.
+####
+FROM builder-base AS builder
+
# Install the package using PDM
RUN pdm install --check --prod --no-editable
+####
+# Container for running tests.
+####
+FROM builder-base as ldr-test
+
+# Install runtime dependencies for SQLCipher
+RUN apt-get update && apt-get install -y \
+ sqlcipher \
+ libsqlcipher0 \
+ && rm -rf /var/lib/apt/lists/*
+
+# Install browser automation tools
+RUN playwright install
+
+# Install the package using PDM
+RUN pdm install --check --no-editable
+# Configure path to default to the venv python.
+ENV PATH="/install/.venv/bin:$PATH"
+
####
# Runs the LDR service.
###