diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b9b9317f..5aa485f1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,7 +7,26 @@ on: workflow_dispatch: jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v4 + with: + enable-cache: true + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version-file: "pyproject.toml" + - name: Install dependencies + run: uv sync --all-extras + - name: Lint + run: uv run ruff check + - name: Type check + run: uv run pyright + test: + needs: lint runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -22,7 +41,3 @@ jobs: run: uv sync --all-extras - name: Run tests run: uv run pytest - - name: Type check - run: uv run pyright - - name: Lint - run: uv run ruff check diff --git a/CHANGELOG.md b/CHANGELOG.md index 54769c6b..f188f85f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,18 @@ # Changelog ## [Unreleased] +### Added + +- **GitHub Actions CI**: Test workflow runs pytest, pyright, and ruff on push/PR to main +- **VCR Cassette Recording**: Integration tests use recorded HTTP responses for deterministic CI runs + - LLM tests (QA, embeddings, research graph) replay from cassettes without real API calls + - docling-serve tests run without Docker container in CI + - Uses pytest-recording with custom JSON body serializer + +### Removed + +- Removed obsolete `test_config_validation_on_db_load` test (chunk_size changes don't invalidate database) + ## [0.23.0] - 2025-12-26 ### Added diff --git a/tests/test_qa.py b/tests/test_qa.py index 75814193..f05204bd 100644 --- a/tests/test_qa.py +++ b/tests/test_qa.py @@ -1,3 +1,4 @@ +import importlib.util from pathlib import Path import pytest @@ -8,6 +9,8 @@ from haiku.rag.client import HaikuRAG from haiku.rag.config.models import ModelConfig from haiku.rag.qa.agent import QuestionAnswerAgent +HAS_ANTHROPIC = importlib.util.find_spec("anthropic") is not None + @pytest.fixture(scope="module") def vcr_cassette_dir(): @@ -63,6 +66,7 @@ async def test_qa_openai(allow_model_requests, qa_corpus: Dataset, temp_db_path) @pytest.mark.vcr() +@pytest.mark.skipif(not HAS_ANTHROPIC, reason="Anthropic not installed") async def test_qa_anthropic(allow_model_requests, qa_corpus: Dataset, temp_db_path): """Test Anthropic QA with LLM judge (VCR recorded).""" client = HaikuRAG(temp_db_path, create=True)