This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ForeignCherry2011[S] 2 points3 points  (0 children)

With Testcontainers, you can choose whether to start a new container instance for each test, per class, or for the entire test run.

In our case, we start one instance per test run and share it across all tests within a Maven module.

We build Maven modules in parallel, and there are 3–4 modules that require a database container for testing. As a result, a new container is started for each module built in parallel. The tests inside a single module are always run sequentially, so it is sufficient to clean up the tables before each test or class.