Skip to content

Feature: Add Isolated Integration Test Database Lifecycle #70

Description

@3m1n3nc3

Description

Provide safe isolated PostgreSQL setup, migrations, factories, cleanup, and parallelism for integration tests.

File Location

learnault-api/tests/setup.ts, learnault-api/tests/integration/, test DB scripts, and Vitest config

Design Reference

API Roadmap Phase 0: Add Isolated Integration Test Database Lifecycle.

Dependencies

  • Status: Blocked
  • Blocked by: Feature: Repair Clean Install and Prisma Generation; Feature: Add Local Docker Compose Development Stack
  • Blocks: Feature: Add Complete Backend CI Quality Gates; API Phase 1 tests

Tasks

  • Use a dedicated test database URL with production-target safeguards
  • Apply migrations once per run
  • Provide factories and isolated suite/transaction state
  • Define safe parallel execution and teardown
  • Remove developer-local and network timing dependencies
  • Add isolation, cleanup, and failure-recovery self-tests

Acceptance Criteria

  • Unsafe database targets are rejected
  • Tests pass in any order
  • Tests do not leak records across cases
  • Cleanup survives failures
  • Self-tests pass

Verification Evidence

  • Attach shuffled/repeated test output and database safety-guard proof

Difficulty

Advanced

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions