3 ms·
The whole point of the article is to make it _fast_: can you share how fast it is to spin up your database with TestContainers?
by williamdclt 3y ago
The whole point of the article is to make it _fast_: can you share how fast it is to spin up your database with TestContainers?
- Traubenfuchs 3y agoRunning an "mvnd clean package" on a very simple Spring Boot app having 4 different spring integration tests takes exactly 8 seconds on my m1 max. This includes a full build of the application, postgres container startup and spring context startup. Starting the postgres container seems be less than 2 seconds of those 8 seconds. Is that fast enough?
- carl_dr 3y agoFrom the article: However, on its own, template databases are not fast enough for our use case. The time it takes to create a new database from a template database is still too high for running thousands of tests: postgres=# CREATE DATABASE foo TEMPLATE contra; CREATE DATABASE Time: 1999.758 ms (00:02.000) So no. They say this adds ~33 minutes to running their tests.
- AlfeG 3y agoYou can utilize all technics from article with the help of TestContainers. They will help with setting up DB and providing connection strings to running images