Skip to content

test: Deterministic test-data factories & seeders #640

@joelpeace48-cell

Description

@joelpeace48-cell

Background & current state

Tests hand-build fixtures inconsistently across the backend/frontend suites, causing duplication and brittle setups. There are no shared factories/seeders.

Goal

Provide deterministic test-data factories + seed scripts for campaigns, participants, API keys, and on-chain fixtures.

Technical design

  • Factory helpers (e.g., makeCampaign(overrides), makeParticipant(...)) producing valid, deterministic objects; seed scripts to populate a DB/local devnet (NEW-090) for E2E.
  • Shared between backend + frontend where sensible; deterministic via seeded RNG.

Edge cases

  • Determinism (seeded RNG) for reproducible tests.
  • Keeping factories in sync with schema changes.
  • Realistic edge fixtures (windows, caps, allowlists).

Task breakdown

  • Factory helpers + seeded RNG.
  • Seed scripts for DB + local devnet.
  • Refactor a sample suite onto factories.

Acceptance criteria

  • Tests use shared factories; seeding is reproducible across runs.

Testing & verification

  • Refactor a representative suite; assert determinism.

Out of scope

  • Full test rewrite.

Dependencies / related

  • Supports all test epics; uses NEW-090.

Difficulty: easy · Effort: S–M · dx

Metadata

Metadata

Assignees

No one assigned

    Labels

    difficulty: easySmall scopedxDeveloper experienceenhancementNew feature or requesttestingTests and test tooling

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions