Skip to content

Commit

Permalink
Uses clickhouse/clickhouse-server as Docker Image in ClickHouseProv…
Browse files Browse the repository at this point in the history
…ider
  • Loading branch information
linghengqian committed Jul 16, 2024
1 parent 01469c3 commit f7ac7e8
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion modules/clickhouse/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ dependencies {
api project(':jdbc')

testImplementation project(':jdbc-test')
testRuntimeOnly 'ru.yandex.clickhouse:clickhouse-jdbc:0.3.2'
testRuntimeOnly 'com.clickhouse:clickhouse-jdbc:0.6.0-patch5:http'
testImplementation 'org.assertj:assertj-core:3.25.3'
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@
*/
public class ClickHouseContainer extends JdbcDatabaseContainer<ClickHouseContainer> {

private static final String NAME = "clickhouse";
public static final String NAME = "clickhouse";

private static final DockerImageName CLICKHOUSE_IMAGE_NAME = DockerImageName.parse("clickhouse/clickhouse-server");

public static final String IMAGE = CLICKHOUSE_IMAGE_NAME.getUnversionedPart();

private static final Integer HTTP_PORT = 8123;

private static final Integer NATIVE_PORT = 9000;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.testcontainers.containers;

import org.testcontainers.clickhouse.ClickHouseContainer;
import org.testcontainers.utility.DockerImageName;

public class ClickHouseProvider extends JdbcDatabaseContainerProvider {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

public interface ClickhouseTestImages {
DockerImageName YANDEX_CLICKHOUSE_IMAGE = DockerImageName.parse("yandex/clickhouse-server:18.10.3");
DockerImageName CLICKHOUSE_IMAGE = DockerImageName.parse("clickhouse/clickhouse-server:21.9.2-alpine");
DockerImageName CLICKHOUSE_IMAGE = DockerImageName.parse("clickhouse/clickhouse-server:24.4.1.2088");
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class ClickHouseContainerTest extends AbstractContainerDatabaseTest {

@Test
public void testSimple() throws SQLException {
try (ClickHouseContainer clickhouse = new ClickHouseContainer("clickhouse/clickhouse-server:21.9.2-alpine")) {
try (ClickHouseContainer clickhouse = new ClickHouseContainer("clickhouse/clickhouse-server:24.4.1.2088")) {
clickhouse.start();

ResultSet resultSet = performQuery(clickhouse, "SELECT 1");
Expand All @@ -25,7 +25,7 @@ public void testSimple() throws SQLException {
@Test
public void customCredentialsWithUrlParams() throws SQLException {
try (
ClickHouseContainer clickhouse = new ClickHouseContainer("clickhouse/clickhouse-server:21.9.2-alpine")
ClickHouseContainer clickhouse = new ClickHouseContainer("clickhouse/clickhouse-server:24.4.1.2088")
.withUsername("test")
.withPassword("test")
.withDatabaseName("test")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.testcontainers.ClickhouseTestImages;
import org.testcontainers.containers.ClickHouseContainer;
import org.testcontainers.clickhouse.ClickHouseContainer;
import org.testcontainers.db.AbstractContainerDatabaseTest;
import org.testcontainers.utility.DockerImageName;

Expand Down

0 comments on commit f7ac7e8

Please sign in to comment.