Skip to content

Commit

Permalink
Merge pull request #593 from gruelbox/reuse-containers
Browse files Browse the repository at this point in the history
Re-use containers
  • Loading branch information
badgerwithagun authored Mar 21, 2024
2 parents 5012cec + ea3077f commit d07bb2e
Show file tree
Hide file tree
Showing 17 changed files with 35 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class TestMySql5 extends AbstractAcceptanceTest {
private static final JdbcDatabaseContainer container =
new MySQLContainer<>("mysql:5")
.withStartupTimeout(Duration.ofMinutes(5))
.withReuse(true)
.withTmpFs(Map.of("/var/lib/mysql", "rw"));

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class TestMySql8 extends AbstractAcceptanceTest {
private static final JdbcDatabaseContainer container =
new MySQLContainer<>("mysql:8")
.withStartupTimeout(Duration.ofMinutes(5))
.withReuse(true)
.withTmpFs(Map.of("/var/lib/mysql", "rw"));

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ class TestPostgres11 extends AbstractAcceptanceTest {
@SuppressWarnings({"rawtypes", "resource"})
private static final JdbcDatabaseContainer container =
(JdbcDatabaseContainer)
new PostgreSQLContainer("postgres:11").withStartupTimeout(Duration.ofHours(1));
new PostgreSQLContainer("postgres:11")
.withStartupTimeout(Duration.ofHours(1))
.withReuse(true);

@Override
protected ConnectionDetails connectionDetails() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ class TestPostgres12 extends AbstractAcceptanceTest {
@SuppressWarnings({"rawtypes", "resource"})
private static final JdbcDatabaseContainer container =
(JdbcDatabaseContainer)
new PostgreSQLContainer("postgres:12").withStartupTimeout(Duration.ofHours(1));
new PostgreSQLContainer("postgres:12")
.withStartupTimeout(Duration.ofHours(1))
.withReuse(true);

@Override
protected ConnectionDetails connectionDetails() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ class TestPostgres13 extends AbstractAcceptanceTest {
@SuppressWarnings({"rawtypes", "resource"})
private static final JdbcDatabaseContainer container =
(JdbcDatabaseContainer)
new PostgreSQLContainer("postgres:13").withStartupTimeout(Duration.ofHours(1));
new PostgreSQLContainer("postgres:13")
.withStartupTimeout(Duration.ofHours(1))
.withReuse(true);

@Override
protected ConnectionDetails connectionDetails() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ class TestPostgres14 extends AbstractAcceptanceTest {
@SuppressWarnings({"rawtypes", "resource"})
private static final JdbcDatabaseContainer container =
(JdbcDatabaseContainer)
new PostgreSQLContainer("postgres:14").withStartupTimeout(Duration.ofHours(1));
new PostgreSQLContainer("postgres:14")
.withStartupTimeout(Duration.ofHours(1))
.withReuse(true);

@Override
protected ConnectionDetails connectionDetails() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ class TestPostgres15 extends AbstractAcceptanceTest {
@SuppressWarnings({"rawtypes", "resource"})
private static final JdbcDatabaseContainer container =
(JdbcDatabaseContainer)
new PostgreSQLContainer("postgres:15").withStartupTimeout(Duration.ofHours(1));
new PostgreSQLContainer("postgres:15")
.withStartupTimeout(Duration.ofHours(1))
.withReuse(true);

@Override
protected ConnectionDetails connectionDetails() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ class TestPostgres16 extends AbstractAcceptanceTest {
@SuppressWarnings({"rawtypes", "resource"})
private static final JdbcDatabaseContainer container =
(JdbcDatabaseContainer)
new PostgreSQLContainer("postgres:16").withStartupTimeout(Duration.ofHours(1));
new PostgreSQLContainer("postgres:16")
.withStartupTimeout(Duration.ofHours(1))
.withReuse(true);

@Override
protected ConnectionDetails connectionDetails() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class TestDefaultPersistorMySql5 extends AbstractPersistorTest {
private static final JdbcDatabaseContainer container =
new MySQLContainer<>("mysql:5")
.withStartupTimeout(Duration.ofMinutes(5))
.withReuse(true)
.withTmpFs(Map.of("/var/lib/mysql", "rw"));

private final DefaultPersistor persistor =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class TestDefaultPersistorMySql8 extends AbstractPersistorTest {
private static final JdbcDatabaseContainer container =
new MySQLContainer<>("mysql:8")
.withStartupTimeout(Duration.ofMinutes(5))
.withReuse(true)
.withTmpFs(Map.of("/var/lib/mysql", "rw"));

private final DefaultPersistor persistor =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ class TestDefaultPersistorPostgres16 extends AbstractPersistorTest {
@SuppressWarnings({"rawtypes", "resource"})
private static final JdbcDatabaseContainer container =
(JdbcDatabaseContainer)
new PostgreSQLContainer("postgres:16").withStartupTimeout(Duration.ofHours(1));
new PostgreSQLContainer("postgres:16")
.withStartupTimeout(Duration.ofHours(1))
.withReuse(true);

private final DefaultPersistor persistor =
DefaultPersistor.builder().dialect(Dialect.POSTGRESQL_9).build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class TestJooqThreadLocalMySql5 extends AbstractJooqAcceptanceThreadLocalTest {
(JdbcDatabaseContainer<?>)
new MySQLContainer("mysql:5")
.withStartupTimeout(Duration.ofMinutes(5))
.withReuse(true)
.withTmpFs(Map.of("/var/lib/mysql", "rw"));

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class TestJooqThreadLocalMySql8 extends AbstractJooqAcceptanceThreadLocalTest {
(JdbcDatabaseContainer<?>)
new MySQLContainer("mysql:8")
.withStartupTimeout(Duration.ofMinutes(5))
.withReuse(true)
.withTmpFs(Map.of("/var/lib/mysql", "rw"));

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ class TestJooqThreadLocalPostgres16 extends AbstractJooqAcceptanceThreadLocalTes
@SuppressWarnings({"rawtypes", "resource"})
private static final JdbcDatabaseContainer container =
(JdbcDatabaseContainer)
new PostgreSQLContainer("postgres:16").withStartupTimeout(Duration.ofHours(1));
new PostgreSQLContainer("postgres:16")
.withStartupTimeout(Duration.ofHours(1))
.withReuse(true);

@Override
protected ConnectionDetails connectionDetails() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class TestVirtualThreadsMySql5 extends AbstractVirtualThreadsTest {
private static final JdbcDatabaseContainer container =
new MySQLContainer<>("mysql:5")
.withStartupTimeout(Duration.ofMinutes(5))
.withReuse(true)
.withTmpFs(Map.of("/var/lib/mysql", "rw"));

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class TestVirtualThreadsMySql8 extends AbstractVirtualThreadsTest {
private static final JdbcDatabaseContainer container =
new MySQLContainer<>("mysql:8")
.withStartupTimeout(Duration.ofMinutes(5))
.withReuse(true)
.withTmpFs(Map.of("/var/lib/mysql", "rw"));

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ class TestVirtualThreadsPostgres16 extends AbstractVirtualThreadsTest {
@SuppressWarnings({"rawtypes", "resource"})
private static final JdbcDatabaseContainer container =
(JdbcDatabaseContainer)
new PostgreSQLContainer("postgres:16").withStartupTimeout(Duration.ofHours(1));
new PostgreSQLContainer("postgres:16")
.withStartupTimeout(Duration.ofHours(1))
.withReuse(true);

@Override
protected ConnectionDetails connectionDetails() {
Expand Down

0 comments on commit d07bb2e

Please sign in to comment.