Skip to content

Testing: Proper db rollback/teardown in place #274

@nishika26

Description

@nishika26

Describe the bug
Currently, after all tests are executed, the database is completely cleared — including the seed data that was pre-inserted. This behavior is not ideal, as we want to retain seed data and only clean up test-specific data after tests run.

Possible Solutions

  • Option 1: Use DB transactions with rollbacks
    Wrap each test in a database transaction and roll it back after the test. This ensures no data is committed while allowing seed data (inserted outside the test scope) to persist.

  • Option 2: Add explicit teardown logic per test
    Explicitly delete test data (e.g., test orgs, projects, users) in fixture teardown steps while leaving seed data untouched.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

Status

Closed

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions