Compare commits

...

8 Commits

Author SHA1 Message Date
Clelia (Astra) Bertelli acfc90d0a8 fix: change name to test_index in unit_tests 2025-08-05 19:26:30 +02:00
Clelia (Astra) Bertelli e80376c97e chore: moving tests 2025-08-05 19:17:28 +02:00
Clelia (Astra) Bertelli 5acca1fc98 ci: run all tests using explicit patterns 2025-08-05 11:16:06 +02:00
Clelia (Astra) Bertelli 68cb4dacd3 chore: differentiate between e2e and non-e2e tests 2025-08-05 11:09:51 +02:00
Clelia (Astra) Bertelli 0b16edf058 fix: test e2e only on PR 2025-08-04 12:29:33 +02:00
Clelia (Astra) Bertelli 5bb9816f04 ci: job name correction 🤦 2025-08-04 12:28:00 +02:00
Clelia (Astra) Bertelli d55f8cf153 ci: workflow name and linting 2025-08-04 12:24:50 +02:00
Clelia (Astra) Bertelli 09a911ee62 fix: run e2e only on 3.12 2025-08-04 12:20:11 +02:00
12 changed files with 61 additions and 19 deletions
+38
View File
@@ -0,0 +1,38 @@
name: Test end-to-end - Python
on:
pull_request:
paths:
- "py/**"
env:
UV_VERSION: "0.7.20"
LLAMA_CLOUD_API_KEY: ${{ secrets.LLAMA_CLOUD_API_KEY }}
jobs:
test_e2e:
runs-on: ubuntu-latest
strategy:
# You can use PyPy versions in python-version.
# For example, pypy-2.7 and pypy-3.8
matrix:
python-version: ["3.12"]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v6
with:
version: ${{ env.UV_VERSION }}
- name: Set up Python
run: uv python install ${{ matrix.python-version }} && uv python pin ${{ matrix.python-version }}
- name: Run Tests
working-directory: py
run: uv run pytest unit_tests/ tests/ -v
- name: Remove virtual environment
working-directory: py
run: rm -rf .venv/
+1 -2
View File
@@ -12,7 +12,6 @@ on:
env:
UV_VERSION: "0.7.20"
LLAMA_CLOUD_API_KEY: ${{ secrets.LLAMA_CLOUD_API_KEY }}
jobs:
test:
@@ -36,7 +35,7 @@ jobs:
- name: Run Tests
working-directory: py
run: uv run -- pytest tests/**/test_*.py
run: uv run pytest unit_tests/ -v
- name: Remove virtual environment
working-directory: py
+1 -1
View File
@@ -33,7 +33,7 @@ repos:
rev: v1.0.1
hooks:
- id: mypy
exclude: ^py/tests/
exclude: ^py/tests|^py/unit_tests
additional_dependencies:
[
"types-requests",
+2 -2
View File
@@ -124,8 +124,8 @@ def extraction_agent(test_case: TestCase, extractor: LlamaExtract):
@pytest.mark.skipif(
"CI" in os.environ,
reason="CI environment is not suitable for benchmarking",
"CI" in os.environ or not LLAMA_CLOUD_API_KEY,
reason="LLAMA_CLOUD_API_KEY not set or CI environment not suitable for benchmarking",
)
@pytest.mark.parametrize("test_case", get_test_cases(), ids=lambda x: x.name)
@pytest.mark.asyncio(loop_scope="session")
-11
View File
@@ -16,7 +16,6 @@ from llama_cloud import (
from llama_cloud.client import LlamaCloud
from llama_index.core.bridge.pydantic import BaseModel
from llama_index.core.constants import DEFAULT_BASE_URL
from llama_index.core.indices.managed.base import BaseManagedIndex
from llama_index.core.schema import Document, ImageNode
from llama_cloud_services.index import (
LlamaCloudIndex,
@@ -93,16 +92,6 @@ def _setup_index_with_file(
return pipeline
def test_class():
names_of_base_classes = [b.__name__ for b in LlamaCloudIndex.__mro__]
assert BaseManagedIndex.__name__ in names_of_base_classes
def test_conflicting_index_identifiers():
with pytest.raises(ValueError):
LlamaCloudIndex(name="test", pipeline_id="test", index_id="test")
@pytest.mark.skipif(
not base_url or not api_key, reason="No platform base url or api key set"
)
View File
+16
View File
@@ -0,0 +1,16 @@
import pytest
from llama_index.core.indices.managed.base import BaseManagedIndex
from llama_cloud_services.index import (
LlamaCloudIndex,
)
def test_class():
names_of_base_classes = [b.__name__ for b in LlamaCloudIndex.__mro__]
assert BaseManagedIndex.__name__ in names_of_base_classes
def test_conflicting_index_identifiers():
with pytest.raises(ValueError):
LlamaCloudIndex(name="test", pipeline_id="test", index_id="test")
@@ -16350,7 +16350,7 @@ export const PromptConfSchema = {
default: `
Provide a brief explanation for how you arrived at the extracted value based on the source text provided.
- For inferred values, explain the reasoning behind the extraction briefly.
- For simple verbatim extraction, output 'VERBATIM EXTRACTION'.
- For simple verbatim extraction, output 'VERBATIM EXTRACTION'.
- When supporting data is not present in the source text, output 'INSUFFICIENT DATA' and emit blank or null values for the value__ field.
`,
},
@@ -17689,7 +17689,7 @@ export const StructParseConfSchema = {
reasoning_prompt: `
Provide a brief explanation for how you arrived at the extracted value based on the source text provided.
- For inferred values, explain the reasoning behind the extraction briefly.
- For simple verbatim extraction, output 'VERBATIM EXTRACTION'.
- For simple verbatim extraction, output 'VERBATIM EXTRACTION'.
- When supporting data is not present in the source text, output 'INSUFFICIENT DATA' and emit blank or null values for the value__ field.
`,
cite_sources_prompt: {
@@ -3219,7 +3219,7 @@ export const zPromptConf = z.object({
reasoning_prompt: z.string().optional().default(`
Provide a brief explanation for how you arrived at the extracted value based on the source text provided.
- For inferred values, explain the reasoning behind the extraction briefly.
- For simple verbatim extraction, output 'VERBATIM EXTRACTION'.
- For simple verbatim extraction, output 'VERBATIM EXTRACTION'.
- When supporting data is not present in the source text, output 'INSUFFICIENT DATA' and emit blank or null values for the value__ field.
`),
cite_sources_prompt: z