Closed m-sokol-esky closed 1 year ago
unfortunately parallel testing with db per test class is not possible. because it's not possible to associate a single entity type with more than one database.
db per test class is only doable with a collection fixture. something like this. but that means no parallel tests.
parallel testing with WAF is only achievable if your seed data doesn't step on each other. you can see an example of this being done here.
the library is going to need a complete rewrite/redesign to support db per test. imho, i don't see the value in that as i personally like to do integration testing against a single test database by overriding the db name via appsettings.json.
I'm trying to run multiple integration tests in parallel using xUnit and WebApplicationFactory. I've run into multiple issues connected with static classes.
I want to have test isolation, so that each test class gets its own database. The problem is that a lot of things are cached in in the DB class using the entity type as a key. Obviously the entiy types are the same across the test classes, so it results in tests using each others databases. Is there any way around this?