mirror of
https://github.com/pcvolkmer/etl-processor.git
synced 2025-04-19 17:26:51 +00:00
Keep database testcontainer alive until all tests are done
This commit is contained in:
parent
bcc23f6b14
commit
4051b5094c
@ -28,7 +28,7 @@ abstract class AbstractTestcontainerTest {
|
|||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
@Container
|
@Container
|
||||||
val dbContainer = PostgreSQLContainer("postgres:10-alpine")
|
val dbContainer = CustomPostgreSQLContainer("postgres:10-alpine")
|
||||||
.withDatabaseName("test")
|
.withDatabaseName("test")
|
||||||
.withUsername("test")
|
.withUsername("test")
|
||||||
.withPassword("test") ?: throw RuntimeException("Failed to create testcontainer!")
|
.withPassword("test") ?: throw RuntimeException("Failed to create testcontainer!")
|
||||||
@ -42,4 +42,10 @@ abstract class AbstractTestcontainerTest {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class CustomPostgreSQLContainer(dockerImageName: String) : PostgreSQLContainer<CustomPostgreSQLContainer>(dockerImageName) {
|
||||||
|
override fun stop() {
|
||||||
|
// Keep Testcontainer alive until JVM destroys it
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user