goldbergyoni / goldbergyoni/nodejs-testing-best-practices
DB cleanup recepie
- Dominant language
- JavaScript
- Stars
- 4.4k
- Forks
- 288
- PR merge metrics
- No merged PRs in 30d
Description
**The setup**
- Dedicated folder or even repo
- Super simple example app in one file - Add & delete order. One column should be unique
- Single test: Delete order, ensure it was deleted. X100 times (run in a loop to test.each)
- 20 tables with relationship
**The options**
- Option1: Delete all tables on beforeEach
- Option2: Delete on global teardown occasionally (once a day or with random)
- Option3: Transactions
**Checks and conclusions**
- The performance of each option under 100 tests
- When cleaning, what is faster: Delete or Truncate
- The performance of a single process (--run-in-band) vs max-1 processes
- The RAM impact of having 6 Postgres vs only 1
Contributor guide
Assessment
This issue has not been assessed yet.