Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 'make test' test failures #3157

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,23 @@ public class RedisContainerIntegrationTests {

private static final String REDIS_STACK_CLUSTER = "clustered-stack";

private static final String REDIS_STACK_VERSION = System.getProperty("REDIS_STACK_VERSION", "8.0-M04-pre");;
private static final String REDIS_STACK_VERSION = System.getProperty("REDIS_STACK_VERSION");

private static Exception initializationException;

public static ComposeContainer CLUSTERED_STACK = new ComposeContainer(
new File("src/test/resources/docker/docker-compose.yml")).withExposedService(REDIS_STACK_CLUSTER, 36379)
.withExposedService(REDIS_STACK_CLUSTER, 36380).withExposedService(REDIS_STACK_CLUSTER, 36381)
.withExposedService(REDIS_STACK_STANDALONE, 6379)
.withEnv("CLIENT_LIBS_TEST_IMAGE", "redislabs/client-libs-test")
.withEnv("REDIS_STACK_VERSION", REDIS_STACK_VERSION).withPull(false).withLocalCompose(true);
.withExposedService(REDIS_STACK_STANDALONE, 6379).withPull(false).withLocalCompose(true);

// Singleton container pattern - start the containers only once
// See https://java.testcontainers.org/test_framework_integration/manual_lifecycle_control/#singleton-containers
static {
int attempts = 0;

if (REDIS_STACK_VERSION != null && !REDIS_STACK_VERSION.isEmpty()) {
CLUSTERED_STACK.withEnv("REDIS_VERSION", REDIS_STACK_VERSION);
}
// In case you need to debug the container uncomment these lines to redirect the output
CLUSTERED_STACK.withLogConsumer(REDIS_STACK_CLUSTER, (OutputFrame frame) -> LOGGER.debug(frame.getUtf8String()));
CLUSTERED_STACK.withLogConsumer(REDIS_STACK_STANDALONE, (OutputFrame frame) -> LOGGER.debug(frame.getUtf8String()));
Expand Down
7 changes: 5 additions & 2 deletions src/test/resources/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
---
x-client-libs-stack-image: &client-libs-stack-image
image: "redislabs/client-libs-test:${REDIS_STACK_VERSION:-8.0-M02}"

services:

standalone-stack:
image: "${CLIENT_LIBS_TEST_IMAGE}:${REDIS_STACK_VERSION}"
<<: *client-libs-stack-image
environment:
- REDIS_CLUSTER=no
- PORT=6379
ports:
- "16379:6379"

clustered-stack:
image: "${CLIENT_LIBS_TEST_IMAGE}:${REDIS_STACK_VERSION}"
<<: *client-libs-stack-image
environment:
- REDIS_CLUSTER=yes
- PORT=36379
Expand Down