Skip to content

Port test infrastructure to backend-agnostic APIs (Phase 3) #2388

@bug-ops

Description

@bug-ops

Parent epic: #2385

Problem

Several test modules use sqlite-specific APIs directly, preventing the test suite from running against PostgreSQL:

  • crates/zeph-memory/src/graph/store/tests.rs:869use sqlx::sqlite::SqliteConnectOptions
  • crates/zeph-index/src/watcher.rs:80sqlx::SqlitePool::connect("sqlite::memory:")
  • crates/zeph-scheduler/src/scheduler.rs:377sqlx::SqlitePool::connect("sqlite::memory:")
  • crates/zeph-memory/src/store/mod.rs:98,113 — sqlite-specific PRAGMAs in tests

Required Changes

  1. Replace all sqlx::SqlitePool::connect("sqlite::memory:") with zeph_db::DbConfig { url: ":memory:".into(), .. }.connect().await
  2. Replace SqliteConnectOptions usage with zeph-db pool creation
  3. Gate sqlite-specific test assertions (PRAGMAs) behind #[cfg(feature = "sqlite")]
  4. Add testcontainers-based postgres test support to consumer crates that need it
  5. Add CI matrix: run workspace tests with both --features sqlite and --features postgres

Acceptance Criteria

  • cargo nextest run --features postgres passes all non-ignored tests
  • CI runs tests against both backends
  • No sqlx::sqlite::* imports outside zeph-db

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2High value, medium complexityenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions