Skip to content

feat: integration test pipeline with containerized services #3

@charlie83Gs

Description

@charlie83Gs

Goal

Run integration tests in CI that exercise cross-service behavior by booting services as container sidecars, similar to how we run Postgres and Redis today.

Background

Worker packages have circular imports when installed in a single venv (see #1). Integration tests that cross service boundaries need isolated runtime environments. The solution is to run each service in its own container during integration test jobs.

Proposed approach

1. No-op base pipeline

Create a base Docker Compose or GitHub Actions service configuration that boots:

  • All infrastructure (Postgres graph-db, Postgres write-db, Redis, Hatchet)
  • Worker services as containers (using the images from ghcr.io/openktree/knowledge-tree/<service>)
  • API service

Each service runs in its own container with its own Python environment, eliminating circular import issues.

2. Integration test job in CI

Add a new job to test.yml (or a separate integration-test.yml):

integration-test:
  name: Integration Tests
  runs-on: ubuntu-latest
  services:
    postgres: ...
    postgres-write: ...
    redis: ...
    # Boot workers as containers
    worker-orchestrator:
      image: ghcr.io/openktree/knowledge-tree/worker-orchestrator:latest
    worker-nodes:
      image: ghcr.io/openktree/knowledge-tree/worker-nodes:latest
    api:
      image: ghcr.io/openktree/knowledge-tree/api:latest
  steps:
    - uses: actions/checkout@v4
    - run: uv run pytest tests/integration/ -x

3. Test structure

tests/
  integration/
    test_exploration_e2e.py      # Full exploration flow
    test_node_pipeline_e2e.py    # Node creation pipeline
    test_sync_e2e.py             # Write-db → graph-db sync
    conftest.py                  # Fixtures pointing to container URLs

Acceptance criteria

  • No-op base pipeline config that boots all services as containers
  • Integration test job in CI that runs after Docker images are built
  • At least one end-to-end test exercising the exploration → node creation flow
  • Integration tests only run on main (not PRs) to keep PR feedback fast

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