Skip to content

buzz-db: shared test infrastructure (scratch DB, community seeding) #20

Description

@TheSentinel454

Every test module that needs Postgres repeats the same boilerplate: PgPool::connect, create_scratch_db, make_community, insert_user, cleanup. There is no shared test utility module. A #[cfg(test)] test-utils submodule with common helpers would reduce duplication and make writing new integration tests easier. Priority: Low — developer productivity improvement.

🤖 AI review update (2026-08-23)

Clarify who must consume the helpers. A plain cfg(test) module works only inside buzz-db; cross-crate and integration tests need tests/common, a dev-only support crate, or a feature-gated support module. Prefer sqlx::test where it fits, unique per-test databases/schemas, deterministic seed builders, and cleanup guards safe under parallel execution.

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

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions