Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
2 changes: 1 addition & 1 deletion packages/modules/arangodb/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM arangodb:3.10.0
FROM arangodb:3.12.4.3
2 changes: 1 addition & 1 deletion packages/modules/cassandra/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM cassandra:5.0.2
FROM cassandra:5.0.4
5 changes: 3 additions & 2 deletions packages/modules/cassandra/src/cassandra-container.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Client } from "cassandra-driver";
import { ImageName } from "testcontainers";
import { getImage } from "../../../testcontainers/src/utils/test-helper";
import { CassandraContainer } from "./cassandra-container";

Expand All @@ -18,7 +19,7 @@
await client.connect();

const result = await client.execute("SELECT release_version FROM system.local");
expect(result.rows[0].release_version).toBe("5.0.2");
expect(result.rows[0].release_version).toBe(ImageName.fromString(IMAGE).tag);

await client.shutdown();
await container.stop();
Expand Down Expand Up @@ -104,7 +105,7 @@

// Fetch and verify the record
const result = await client.execute("SELECT * FROM test_keyspace.users WHERE id = ?", [id], { prepare: true });
expect(result.rows[0].name).toBe(username);

Check failure on line 108 in packages/modules/cassandra/src/cassandra-container.test.ts

View workflow job for this annotation

GitHub Actions / Tests (cassandra, 24.x, docker) / Run

packages/modules/cassandra/src/cassandra-container.test.ts > Cassandra > should create keyspace, a table, insert data, and retrieve it

TypeError: Cannot read properties of undefined (reading 'name') ❯ packages/modules/cassandra/src/cassandra-container.test.ts:108:27

await client.shutdown();
await container.stop();
Expand All @@ -124,7 +125,7 @@
await client.connect();

const result = await client.execute("SELECT release_version FROM system.local");
expect(result.rows[0].release_version).toBe("5.0.2");
expect(result.rows[0].release_version).toBe(ImageName.fromString(IMAGE).tag);

await client.shutdown();
await container.stop();
Expand Down
2 changes: 1 addition & 1 deletion packages/modules/chromadb/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM chromadb/chroma:0.6.3
FROM chromadb/chroma:1.0.10
2 changes: 1 addition & 1 deletion packages/modules/clickhouse/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM clickhouse/clickhouse-server:25.3-alpine
FROM clickhouse/clickhouse-server:25.5-alpine
2 changes: 1 addition & 1 deletion packages/modules/cockroachdb/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM cockroachdb/cockroach:v24.3.5
FROM cockroachdb/cockroach:v25.2.0
2 changes: 1 addition & 1 deletion packages/modules/couchbase/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM couchbase/server:6.5.1
FROM couchbase/server:7.6.6
2 changes: 1 addition & 1 deletion packages/modules/elasticsearch/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM elasticsearch:7.17.7
FROM elasticsearch:9.0.1
34 changes: 29 additions & 5 deletions packages/modules/elasticsearch/src/elasticsearch-container.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ import { getImage } from "../../../testcontainers/src/utils/test-helper";
import { ElasticsearchContainer } from "./elasticsearch-container";

const IMAGE = getImage(__dirname);
const images = ["elasticsearch:7.17.28", "elasticsearch:8.18.1", IMAGE];

describe("ElasticsearchContainer", { timeout: 180_000 }, () => {
// createIndex {
it("should create an index", async () => {
const container = await new ElasticsearchContainer(IMAGE).start();
const client = new Client({ node: container.getHttpUrl() });
it.each(images)("should create an index with %s", async (image) => {
const container = await new ElasticsearchContainer(image).start();
const client = new Client({
node: container.getHttpUrl(),
auth: { username: container.getUsername(), password: container.getPassword() },
});

await client.indices.create({ index: "people" });

Expand All @@ -20,7 +24,10 @@ describe("ElasticsearchContainer", { timeout: 180_000 }, () => {
// indexDocument {
it("should index a document", async () => {
const container = await new ElasticsearchContainer(IMAGE).start();
const client = new Client({ node: container.getHttpUrl() });
const client = new Client({
node: container.getHttpUrl(),
auth: { username: container.getUsername(), password: container.getPassword() },
});

const document = {
id: "1",
Expand All @@ -41,7 +48,24 @@ describe("ElasticsearchContainer", { timeout: 180_000 }, () => {
const container = await new ElasticsearchContainer(IMAGE).start();
await container.restart();

const client = new Client({ node: container.getHttpUrl() });
const client = new Client({
node: container.getHttpUrl(),
auth: { username: container.getUsername(), password: container.getPassword() },
});

await client.indices.create({ index: "people" });

expect(await client.indices.exists({ index: "people" })).toBe(true);
await container.stop();
}); // }

it("should set custom password", async () => {
const container = await new ElasticsearchContainer(IMAGE).withPassword("testPassword").start();

const client = new Client({
node: container.getHttpUrl(),
auth: { username: container.getUsername(), password: container.getPassword() },
});

await client.indices.create({ index: "people" });

Expand Down
41 changes: 37 additions & 4 deletions packages/modules/elasticsearch/src/elasticsearch-container.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,53 @@
import { AbstractStartedContainer, GenericContainer, StartedTestContainer } from "testcontainers";
import { AbstractStartedContainer, GenericContainer, StartedTestContainer, Wait } from "testcontainers";

const ELASTIC_SEARCH_HTTP_PORT = 9200;

export class ElasticsearchContainer extends GenericContainer {
private password = "changeme";
private readonly username = "elastic";
private readonly defaultWaitStrategy = Wait.forHttp("/", ELASTIC_SEARCH_HTTP_PORT).withBasicCredentials(
this.username,
this.password
);

constructor(image: string) {
super(image);
this.withExposedPorts(ELASTIC_SEARCH_HTTP_PORT)
.withEnvironment({ "discovery.type": "single-node" })
.withEnvironment({
"discovery.type": "single-node",
"xpack.security.http.ssl.enabled": "false",
})
.withCopyContentToContainer([
{
content: "-Xmx2G\n",
target: "/usr/share/elasticsearch/config/jvm.options.d/elasticsearch-default-memory-vm.options",
},
])
.withWaitStrategy(this.defaultWaitStrategy)
.withStartupTimeout(120_000);
}

public withPassword(password: string): this {
this.password = password;
this.defaultWaitStrategy.withBasicCredentials(this.username, this.password);
return this;
}

public override async start(): Promise<StartedElasticsearchContainer> {
return new StartedElasticsearchContainer(await super.start());
this.withEnvironment({
ELASTIC_PASSWORD: this.password,
});

return new StartedElasticsearchContainer(await super.start(), this.username, this.password);
}
}

export class StartedElasticsearchContainer extends AbstractStartedContainer {
constructor(override readonly startedTestContainer: StartedTestContainer) {
constructor(
override readonly startedTestContainer: StartedTestContainer,
private readonly username: string,
private readonly password: string
) {
super(startedTestContainer);
}

Expand All @@ -33,4 +58,12 @@
public getHttpUrl(): string {
return `http://${this.getHost()}:${this.getPort()}`;
}

public getUsername(): string {
return this.username;
}

public getPassword(): string {
return this.password;
}
}
2 changes: 1 addition & 1 deletion packages/modules/gcloud/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM gcr.io/google.com/cloudsdktool/cloud-sdk:517.0.0-emulators
FROM gcr.io/google.com/cloudsdktool/cloud-sdk:523.0.1-emulators
FROM fsouza/fake-gcs-server:1.52.2
FROM ghcr.io/goccy/bigquery-emulator:0.6.6
2 changes: 1 addition & 1 deletion packages/modules/hivemq/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM hivemq/hivemq-ce:2023.5
FROM hivemq/hivemq-ce:2025.3
2 changes: 1 addition & 1 deletion packages/modules/k3s/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM rancher/k3s:v1.31.2-k3s1
FROM rancher/k3s:v1.33.1-k3s1
2 changes: 1 addition & 1 deletion packages/modules/kafka/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM confluentinc/cp-kafka:7.2.2
FROM confluentinc/cp-kafka:7.9.1
2 changes: 1 addition & 1 deletion packages/modules/localstack/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM localstack/localstack:2.2.0
FROM localstack/localstack:4.4.0
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ describe("LocalStackContainer", { timeout: 180_000 }, () => {
const container = await new LocalstackContainer(IMAGE)
.withNetwork(network)
.withNetworkAliases("notthis", "localstack") // the last alias is used for HOSTNAME_EXTERNAL
.withEnvironment({ SQS_ENDPOINT_STRATEGY: "path" })
.start();

const awsCliInDockerNetwork = await new GenericContainer("amazon/aws-cli:2.7.27")
Expand Down
2 changes: 1 addition & 1 deletion packages/modules/mariadb/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM mariadb:11.5.2
FROM mariadb:11.7.2
2 changes: 1 addition & 1 deletion packages/modules/mongodb/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM mongo:4.0.1
FROM mongo:8.0.9
2 changes: 1 addition & 1 deletion packages/modules/mysql/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM mysql:8.0.31
FROM mysql:9.3.0
2 changes: 1 addition & 1 deletion packages/modules/nats/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM nats:2.8.4-alpine
FROM nats:2.11.4-alpine
2 changes: 1 addition & 1 deletion packages/modules/neo4j/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM neo4j:4.4.12
FROM neo4j:5.26.7
2 changes: 1 addition & 1 deletion packages/modules/ollama/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM ollama/ollama:0.1.44
FROM ollama/ollama:0.7.1
3 changes: 2 additions & 1 deletion packages/modules/ollama/src/ollama-container.test.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { ImageName } from "testcontainers";
import { getImage } from "../../../testcontainers/src/utils/test-helper";
import { OllamaContainer } from "./ollama-container";

Expand All @@ -11,7 +12,7 @@ describe("OllamaContainer", { timeout: 180_000 }, () => {
const response = await fetch(`${container.getEndpoint()}/api/version`);
expect(response.status).toEqual(200);
const body = (await response.json()) as { version: string };
expect(body.version).toEqual("0.1.44");
expect(body.version).toEqual(ImageName.fromString(IMAGE).tag);
await container.stop();
});

Expand Down
2 changes: 1 addition & 1 deletion packages/modules/postgresql/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM postgres:13.3-alpine
FROM postgres:17.5-alpine
2 changes: 1 addition & 1 deletion packages/modules/qdrant/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM qdrant/qdrant:v1.13.4
FROM qdrant/qdrant:v1.14.1
2 changes: 1 addition & 1 deletion packages/modules/rabbitmq/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM rabbitmq:3.12.11-management-alpine
FROM rabbitmq:4.1.0-management-alpine
2 changes: 1 addition & 1 deletion packages/modules/redis/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM redis:7.2
FROM redis:8.0
2 changes: 1 addition & 1 deletion packages/modules/redpanda/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM docker.redpanda.com/redpandadata/redpanda:v23.3.10
FROM docker.redpanda.com/redpandadata/redpanda:v25.1.4
2 changes: 1 addition & 1 deletion packages/modules/scylladb/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM scylladb/scylla:6.2.0
FROM scylladb/scylla:6.2.3
2 changes: 1 addition & 1 deletion packages/modules/selenium/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM selenium/standalone-chrome:112.0
FROM selenium/standalone-chrome:136.0
2 changes: 1 addition & 1 deletion packages/modules/toxiproxy/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM ghcr.io/shopify/toxiproxy:2.11.0
FROM ghcr.io/shopify/toxiproxy:2.12.0
2 changes: 1 addition & 1 deletion packages/modules/valkey/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM valkey/valkey:8.0
FROM valkey/valkey:8.1
2 changes: 1 addition & 1 deletion packages/modules/weaviate/Dockerfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
FROM semitechnologies/weaviate:1.24.5
FROM semitechnologies/weaviate:1.30.6
Loading