Skip to content

test(db): isolate destructive RLS fixtures from owner integration data #614

Description

@tiankaima

Problem

The account-deletion RLS scenario intentionally deletes the second seeded user. This mutates shared seed state: related comment authors are set to null, and the idempotent seed does not restore that relationship. Running the RLS files in one Vitest process can also race Todo assertions against that deletion. Reusing the database for the owner integration suite then produces order-dependent failures.

This was reproduced while validating #613. Each suite passes on a fresh database and the canonical CI jobs pass because the RLS specs run as separate processes.

Desired contract

  • Destructive account-deletion tests own isolated user/content fixtures.
  • RLS test files can run together without sharing mutable seeded identities.
  • Owner integration can run after RLS tests, or the test harness explicitly provisions independent databases and documents that boundary.
  • Seed idempotency remains unchanged unless restoring mutable relationships is deliberately chosen and tested.

Acceptance criteria

  • A single invocation of all RLS integration files is deterministic.
  • Account deletion no longer mutates fixtures consumed by unrelated suites.
  • CI keeps the separate runtime-role contract and owner integration coverage.
  • The test harness cleans all generated identities and databases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions