Hacker News new | past | comments | ask | show | jobs | submit login

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?



Running 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?


From 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.


You 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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: