Skip to content

Ollama integration test (env-gated) exercising the LLM + embedding path #9

Description

@ronaldmannak

Motivation

All current tests run offline (HashEmbedder + pattern extractor). The Ollama-backed path (OllamaClient, OllamaEmbedder, LLM entity extraction, LLM answer synthesis, and — once merged — LLM community summaries) has no automated coverage.

Scope

  • Add an integration test that, only when an env var is set (e.g. GRAPHRAG_OLLAMA_TESTS=1 + OLLAMA_HOST), builds a small graph with the Ollama backends and asserts ask / lightRAG().ask return non-empty, grounded answers.
  • The test must skip cleanly (no failure) when the env var is unset, so default CI stays fully offline.
  • Optional: a separate, manually-triggered CI job (workflow_dispatch) that runs the Ollama tests against a service container.

Files (isolated)

Tests/GraphRAGTests/ (new OllamaIntegrationTests.swift), optionally .github/workflows/. No library source changes.

Acceptance criteria

  • Default swift test (no env var) skips the integration test and stays green with no network access.
  • With the env var + a reachable Ollama, the test exercises the real LLM/embedding path.
  • CI green.

Context: follow-up to PRs #2 / #3.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions