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
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:
ghcr.io/openktree/knowledge-tree/<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 separateintegration-test.yml):3. Test structure
Acceptance criteria