With huge sets of integration tests, data setup is becoming somewhat of an obstacle in terms of runtime.
What is your experience to tackle similar situations?
Scenario: 200 API integration tests concerning contracts, for which data prerequisites include the existence of a company and a person, each in a specific (non-default) state.
Case 1: each test sets up its own data
- Pro: test data is managed within test, no interference with other data
- Con: creating new companies/people for every test greatly slows down total runtime
Case 2: data setup is done mostly on test project level
- Con: test data is managed across all tests in the project, making it harder to manage and prevent cross-influences
- Pro: creating reusable companies/people the data setup is much smaller, leading to way faster runtimes (tried and tested...)
Case 3: data setup is done using database restore/snapshots
- Con: test data is managed across all tests in the project, making it harder to manage and prevent cross-influences
- Pro: creating reusable companies/people the data setup is much smaller, leading to way faster runtimes
- Con: running and debugging individual tests against a deployed environment will be very difficult and time-consuming if the entire database needs to be restored