when it comes to using testcontainers-modules for different modulus foeinstance postgres module, it's practically impossible to carry out a real integration test for postgres data persistency, because each integration test uses a different database instance, thus all data stored in it is drop when the database is stopped making it tedious to check data persistency, but however using volumes and advanded docker option allow us to:
-
Mounts a volume at /var/lib/module/data, which is where module stores its data.
-
That means data written to the DB is stored in the mounted directory (/tmp/module_data_test), not lost with the container lifecycle.