diff --git a/.github/workflows/pr-functional-tests.yml b/.github/workflows/pr-functional-tests.yml index fba38aa940a..d246a836fa9 100644 --- a/.github/workflows/pr-functional-tests.yml +++ b/.github/workflows/pr-functional-tests.yml @@ -36,4 +36,4 @@ jobs: ${{ runner.os }}-maven- - name: Build with Maven - run: mvn -B verify -DskipUnitTests=true --file extra/pom.xml + run: mvn -B verify -DskipUnitTests=true -Dmax.containers.count=5 --file extra/pom.xml diff --git a/pom.xml b/pom.xml index 2a886b62458..00f817658fc 100644 --- a/pom.xml +++ b/pom.xml @@ -748,6 +748,7 @@ target/allure-results ${mockserver-client.version} ${project.version} + 2 diff --git a/src/test/groovy/org/prebid/server/functional/testcontainers/Dependencies.groovy b/src/test/groovy/org/prebid/server/functional/testcontainers/Dependencies.groovy index 20b870dc337..18488ac9d86 100644 --- a/src/test/groovy/org/prebid/server/functional/testcontainers/Dependencies.groovy +++ b/src/test/groovy/org/prebid/server/functional/testcontainers/Dependencies.groovy @@ -2,13 +2,15 @@ package org.prebid.server.functional.testcontainers import org.prebid.server.functional.testcontainers.container.NetworkServiceContainer import org.prebid.server.functional.util.ObjectMapperWrapper +import org.prebid.server.functional.util.PBSUtils import org.testcontainers.containers.MySQLContainer import org.testcontainers.containers.Network import org.testcontainers.lifecycle.Startables class Dependencies { - private static final Boolean IS_LAUNCH_CONTAINERS = Boolean.valueOf(System.getProperty("launchContainers")) + private static final Boolean IS_LAUNCH_CONTAINERS = Boolean.valueOf( + PBSUtils.getPropertyOrDefault("launchContainers", "false")) static final ObjectMapperWrapper objectMapperWrapper = new ObjectMapperWrapper() diff --git a/src/test/groovy/org/prebid/server/functional/testcontainers/PbsServiceFactory.groovy b/src/test/groovy/org/prebid/server/functional/testcontainers/PbsServiceFactory.groovy index ad40d76bf86..f78f93aa1b7 100644 --- a/src/test/groovy/org/prebid/server/functional/testcontainers/PbsServiceFactory.groovy +++ b/src/test/groovy/org/prebid/server/functional/testcontainers/PbsServiceFactory.groovy @@ -4,11 +4,13 @@ import org.prebid.server.functional.service.PrebidServerService import org.prebid.server.functional.testcontainers.container.NetworkServiceContainer import org.prebid.server.functional.testcontainers.container.PrebidServerContainer import org.prebid.server.functional.util.ObjectMapperWrapper +import org.prebid.server.functional.util.PBSUtils class PbsServiceFactory { private static final Map, PrebidServerContainer> containers = [:] - private static final int MAX_CONTAINERS_COUNT = 5 + private static final int MAX_CONTAINERS_COUNT = Integer.parseInt( + PBSUtils.getPropertyOrDefault("max.containers.count", "2")) private final ObjectMapperWrapper mapper private final NetworkServiceContainer networkServiceContainer diff --git a/src/test/groovy/org/prebid/server/functional/util/PBSUtils.groovy b/src/test/groovy/org/prebid/server/functional/util/PBSUtils.groovy index 3189908f775..1dccc13f1a0 100644 --- a/src/test/groovy/org/prebid/server/functional/util/PBSUtils.groovy +++ b/src/test/groovy/org/prebid/server/functional/util/PBSUtils.groovy @@ -50,4 +50,8 @@ class PBSUtils { } path } + + static String getPropertyOrDefault(String property, String defaultValue) { + System.getProperty(property) ?: defaultValue + } }