Skip to content

Commit

Permalink
Tests: Fix startup for localstack container (prebid#3436)
Browse files Browse the repository at this point in the history
  • Loading branch information
marki1an authored and sergseven committed Dec 23, 2024
1 parent febf916 commit f6a3d03
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import org.testcontainers.lifecycle.Startables
import org.testcontainers.utility.DockerImageName

import static org.prebid.server.functional.util.SystemProperties.MOCKSERVER_VERSION
import static org.testcontainers.containers.localstack.LocalStackContainer.Service.S3

class Dependencies {

Expand All @@ -36,21 +37,21 @@ class Dependencies {
static final NetworkServiceContainer networkServiceContainer = new NetworkServiceContainer(MOCKSERVER_VERSION)
.withNetwork(network)

static final LocalStackContainer localStackContainer = new LocalStackContainer(DockerImageName.parse("localstack/localstack:s3-latest"))
.withNetwork(Dependencies.network)
.withServices(LocalStackContainer.Service.S3)
static LocalStackContainer localStackContainer

static void start() {
if (IS_LAUNCH_CONTAINERS) {
Startables.deepStart([networkServiceContainer, mysqlContainer, localStackContainer])
.join()
localStackContainer = new LocalStackContainer(DockerImageName.parse("localstack/localstack:s3-latest"))
.withNetwork(network)
.withServices(S3)
Startables.deepStart([networkServiceContainer, mysqlContainer, localStackContainer]).join()
}
}

static void stop() {
if (IS_LAUNCH_CONTAINERS) {
[networkServiceContainer, mysqlContainer, localStackContainer].parallelStream()
.forEach({ it.stop() })
.forEach({ it.stop() })
}
}

Expand Down

0 comments on commit f6a3d03

Please sign in to comment.