Re:Using short lived Postgres servers for testing
by JBorrow on Thursday June 27, 2024 @04:26PM
(#40814718)
Yes, I use this kind of setup in a number of places. I am also a fan of running the full test suite using SQLite (if you are using a compatible ORM) to make sure where you are (or not) running into DB-specific behavior.
[ Parent
| on HN ]
Re:Using short lived Postgres servers for testing
by esafak on Thursday June 27, 2024 @04:28PM
(#40814737)
With testcontainers you can use exactly the same database you do in production.
Re:Using short lived Postgres servers for testing
by pvorb on Thursday June 27, 2024 @05:13PM
(#40815184)
If your application only uses one database in production, you probably don't want to use an ORM, because that might prevent you from using all of your db’s features.
Re:Using short lived Postgres servers for testing
by esafak on Thursday June 27, 2024 @07:48PM
(#40816429)
The testcontainer is agnostic to how you use it; it's a real docker container.
Re:Using short lived Postgres servers for testing
by JBorrow on Friday June 28, 2024 @12:47PM
(#40822438)
Sure, but you may want to use different databases as your application may be expected to be deployed in different environments. I like to keep some of my apps db-agnostic, so I test with postgres in a testcontainer and sqlite outside of one to ensure consistency.