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

Update redis version #8631

Merged
merged 3 commits into from
May 14, 2024
Merged
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
6 changes: 3 additions & 3 deletions core/src/test/java/org/testcontainers/TestImages.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import org.testcontainers.utility.DockerImageName;

public interface TestImages {
DockerImageName REDIS_IMAGE = DockerImageName.parse("redis:3.0.2");
DockerImageName RABBITMQ_IMAGE = DockerImageName.parse("rabbitmq:3.5.3");
DockerImageName MONGODB_IMAGE = DockerImageName.parse("mongo:3.1.5");
DockerImageName REDIS_IMAGE = DockerImageName.parse("redis:6-alpine");
DockerImageName RABBITMQ_IMAGE = DockerImageName.parse("rabbitmq:3.7.25");
DockerImageName MONGODB_IMAGE = DockerImageName.parse("mongo:4.4");
DockerImageName ALPINE_IMAGE = DockerImageName.parse("alpine:3.17");
DockerImageName DOCKER_REGISTRY_IMAGE = DockerImageName.parse("registry:2.7.0");
DockerImageName TINY_IMAGE = DockerImageName.parse("alpine:3.17");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public void testArchitectureCheck() {
@Test
public void shouldReturnTheProvidedImage() {
GenericContainer container = new GenericContainer(TestImages.REDIS_IMAGE);
assertThat(container.getImage().get()).isEqualTo("redis:3.0.2");
assertThat(container.getImage().get()).isEqualTo("redis:6-alpine");
container.setImage(new RemoteDockerImage(TestImages.ALPINE_IMAGE));
assertThat(container.getImage().get()).isEqualTo("alpine:3.17");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class DockerComposeLocalImageTest {

@Test
public void usesLocalImageEvenWhenPullFails() throws InterruptedException {
tagImage("redis:4.0.10", "redis-local", "latest");
tagImage("redis:6-alpine", "redis-local", "latest");

DockerComposeContainer composeContainer = new DockerComposeContainer(
new File("src/test/resources/local-compose-test.yml")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.7'
services:
redis:
image: redis:2.6.17
image: redis:6-alpine
deploy:
resources:
limits:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public class CmdModifierTest {

// hostname {
@Rule
public GenericContainer theCache = new GenericContainer<>(DockerImageName.parse("redis:3.0.2"))
public GenericContainer theCache = new GenericContainer<>(DockerImageName.parse("redis:6-alpine"))
.withCreateContainerCmdModifier(cmd -> cmd.withHostName("the-cache"));

// }
Expand All @@ -30,7 +30,7 @@ public class CmdModifierTest {
private long memorySwapInBytes = 64l * 1024l * 1024l;

@Rule
public GenericContainer memoryLimitedRedis = new GenericContainer<>(DockerImageName.parse("redis:3.0.2"))
public GenericContainer memoryLimitedRedis = new GenericContainer<>(DockerImageName.parse("redis:6-alpine"))
.withCreateContainerCmdModifier(cmd -> {
cmd.getHostConfig()
.withMemory(memoryInBytes)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class CommandsTest {

@Rule
// startupCommand {
public GenericContainer redisWithCustomPort = new GenericContainer(DockerImageName.parse("redis:5.0"))
public GenericContainer redisWithCustomPort = new GenericContainer(DockerImageName.parse("redis:6-alpine"))
.withCommand("redis-server --port 7777")
// }
.withExposedPorts(7777);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public class ContainerCreationTest {

// spotless:off
// simple {
public static final DockerImageName REDIS_IMAGE = DockerImageName.parse("redis:3.0.2");
public static final DockerImageName REDIS_IMAGE = DockerImageName.parse("redis:6-alpine");

@ClassRule
public static GenericContainer<?> redis = new GenericContainer<>(REDIS_IMAGE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class DependsOnTest {

@Rule
// dependsOn {
public GenericContainer<?> redis = new GenericContainer<>("redis:3.0.2").withExposedPorts(6379);
public GenericContainer<?> redis = new GenericContainer<>("redis:6-alpine").withExposedPorts(6379);

@Rule
public GenericContainer<?> nginx = new GenericContainer<>("nginx:1.9.4").dependsOn(redis).withExposedPorts(80);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class WaitStrategiesTest {

@Rule
// logMessageWait {
public GenericContainer containerWithLogWait = new GenericContainer(DockerImageName.parse("redis:5.0.3"))
public GenericContainer containerWithLogWait = new GenericContainer(DockerImageName.parse("redis:6-alpine"))
.withExposedPorts(6379)
.waitingFor(Wait.forLogMessage(".*Ready to accept connections.*\\n", 1));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class RedisBackedCacheIntTest {

// rule {
@Rule
public GenericContainer redis = new GenericContainer(DockerImageName.parse("redis:5.0.3-alpine"))
public GenericContainer redis = new GenericContainer(DockerImageName.parse("redis:6-alpine"))
.withExposedPorts(6379);

// }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class RedisBackedCacheIntTest {

// container {
@Container
public GenericContainer redis = new GenericContainer(DockerImageName.parse("redis:5.0.3-alpine"))
public GenericContainer redis = new GenericContainer(DockerImageName.parse("redis:6-alpine"))
.withExposedPorts(6379);

// }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class RedisBackedCacheIntTest extends Specification {
private RedisBackedCache underTest

// init {
GenericContainer redis = new GenericContainer<>("redis:5.0.3-alpine")
GenericContainer redis = new GenericContainer<>("redis:6-alpine")
.withExposedPorts(6379)
// }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/
public class RedisBackedCacheTest {

private static GenericContainer<?> redis = new GenericContainer<>(DockerImageName.parse("redis:3.0.6"))
private static GenericContainer<?> redis = new GenericContainer<>(DockerImageName.parse("redis:6-alpine"))
.withExposedPorts(6379);

private Cache cache;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
class RedisBackedCacheTest {

@Container
public GenericContainer<?> redis = new GenericContainer<>(DockerImageName.parse("redis:3.0.6"))
public GenericContainer<?> redis = new GenericContainer<>(DockerImageName.parse("redis:6-alpine"))
.withExposedPorts(6379);

private Cache cache;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

public abstract class AbstractIntegrationTest {

public static final GenericContainer<?> redis = new GenericContainer<>(DockerImageName.parse("redis:3.0.6"))
public static final GenericContainer<?> redis = new GenericContainer<>(DockerImageName.parse("redis:6-alpine"))
.withExposedPorts(6379);

static {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import org.testcontainers.containers.GenericContainer
abstract class AbstractIntegrationTest {

companion object {
val redisContainer = GenericContainer<Nothing>("redis:3-alpine")
val redisContainer = GenericContainer<Nothing>("redis:6-alpine")
.apply { withExposedPorts(6379) }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
@ActiveProfiles("test")
abstract class AbstractIntegrationTest {

static GenericContainer<?> redis = new GenericContainer<>(DockerImageName.parse("redis:3-alpine"))
static GenericContainer<?> redis = new GenericContainer<>(DockerImageName.parse("redis:6-alpine"))
.withExposedPorts(6379);

@DynamicPropertySource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
public class RedisContainer extends GenericContainer<RedisContainer> {

public RedisContainer() {
super(DockerImageName.parse("redis:3.2.11"));
super(DockerImageName.parse("redis:6-alpine"));
withExposedPorts(6379);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class ToxiproxyTest {

// The target container - this could be anything
@Rule
public GenericContainer<?> redis = new GenericContainer<>("redis:5.0.4")
public GenericContainer<?> redis = new GenericContainer<>("redis:6-alpine")
.withExposedPorts(6379)
.withNetwork(network)
.withNetworkAliases("redis");
Expand Down Expand Up @@ -114,7 +114,7 @@ public void testConnectionCut() throws IOException {
@Test
public void testMultipleProxiesCanBeCreated() throws IOException {
try (
GenericContainer<?> secondRedis = new GenericContainer<>("redis:5.0.4")
GenericContainer<?> secondRedis = new GenericContainer<>("redis:6-alpine")
.withExposedPorts(6379)
.withNetwork(network)
.withNetworkAliases("redis2")
Expand Down
Loading