dotnet / dotnet/efcore

Use respawn to speed up tests which need to clean data

Open
#27,508 0 comments 0 reactions 0 assignees View on GitHub
area-perf area-test
Dominant language
C#
Stars
14.8k
Forks
3.4k
PR merge metrics
PR metrics pending

Description

While working on #27372, I'm creating a big test suite that needs to reseed the database between each tests (I can't use transactions to roll back since the implicit transaction in SaveChanges is what's being tested). Our default way for doing this is currently with the database cleaner, which means we reverse-engineer the database, drops all tables and recreate the schema. This takes up far more time than test itself on SQL Server.

We could use [respawn](https://github.com/jbogard/respawn) instead - that's exactly what it's built to do.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.