Skip to content

Commit 288f04b

Browse files
committed
feat: update ClickHouse service configuration and host references in Docker Compose and test agent config
1 parent 22c4858 commit 288f04b

4 files changed

Lines changed: 75 additions & 21 deletions

File tree

backend/test/mock.factory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export class MockFactory {
108108
const dto = new CreateConnectionDto() as any;
109109
dto.title = 'Test connection to ClickHouse in Docker';
110110
dto.type = 'clickhouse';
111-
dto.host = 'clickhouse-e2e-testing';
111+
dto.host = 'test-clickhouse-e2e-testing';
112112
dto.port = 8123;
113113
dto.username = 'default';
114114
dto.password = 'clickhouse_password';

docker-compose.tst.yml

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ services:
3333
condition: service_healthy
3434
test-clickhouse-e2e-testing:
3535
condition: service_healthy
36+
test-elasticsearch-e2e-testing:
37+
condition: service_healthy
3638
command: ["/bin/sh", "-c", "pnpm test-all $EXTRA_ARGS"]
3739
develop:
3840
watch:
@@ -222,7 +224,8 @@ services:
222224
start_period: 10s
223225

224226
test-clickhouse-e2e-testing:
225-
image: clickhouse/clickhouse-server:latest
227+
image: clickhouse/clickhouse-server:24.8
228+
restart: unless-stopped
226229
ports:
227230
- 8123:8123
228231
- 9000:9000
@@ -236,7 +239,39 @@ services:
236239
soft: 262144
237240
hard: 262144
238241
healthcheck:
239-
test: [ "CMD", "wget", "--spider", "-q", "http://localhost:8123/ping" ]
240-
interval: 30s
241-
timeout: 10s
242-
retries: 3
242+
test:
243+
[
244+
"CMD",
245+
"clickhouse-client",
246+
"--user=default",
247+
"--password=clickhouse_password",
248+
"--query=SELECT 1",
249+
]
250+
interval: 10s
251+
timeout: 5s
252+
retries: 20
253+
start_period: 60s
254+
255+
test-elasticsearch-e2e-testing:
256+
image: docker.elastic.co/elasticsearch/elasticsearch:8.15.0
257+
environment:
258+
- discovery.type=single-node
259+
- xpack.security.enabled=true
260+
- ELASTIC_PASSWORD=SuperSecretElasticPassword
261+
- ES_JAVA_OPTS=-Xms512m -Xmx512m
262+
ports:
263+
- 9200:9200
264+
ulimits:
265+
memlock:
266+
soft: -1
267+
hard: -1
268+
healthcheck:
269+
test:
270+
[
271+
"CMD-SHELL",
272+
"curl -s -u elastic:SuperSecretElasticPassword http://localhost:9200/_cluster/health | grep -E '\"status\":\"(green|yellow)\"'",
273+
]
274+
interval: 10s
275+
timeout: 5s
276+
retries: 20
277+
start_period: 60s

docker-compose.yml

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ services:
2323
- cassandra-init
2424
- test-cassandra-e2e-testing
2525
- test-redis-e2e-testing
26-
- clickhouse-e2e-testing
26+
- test-clickhouse-e2e-testing
2727
links:
2828
- postgres
2929
- testMySQL-e2e-testing
@@ -36,7 +36,7 @@ services:
3636
- test-elasticsearch-e2e-testing
3737
- test-cassandra-e2e-testing
3838
- test-redis-e2e-testing
39-
- clickhouse-e2e-testing
39+
- test-clickhouse-e2e-testing
4040
command: ["pnpm", "start"]
4141

4242
testMySQL-e2e-testing:
@@ -170,11 +170,21 @@ services:
170170
- discovery.type=single-node
171171
- ELASTIC_PASSWORD=SuperSecretElasticPassword
172172
- xpack.security.enabled=true
173+
- ES_JAVA_OPTS=-Xms512m -Xmx512m
174+
ulimits:
175+
memlock:
176+
soft: -1
177+
hard: -1
173178
healthcheck:
174-
test: ["CMD", "curl", "-f", "http://localhost:9200"]
175-
interval: 30s
176-
timeout: 10s
177-
retries: 3
179+
test:
180+
[
181+
"CMD-SHELL",
182+
"curl -s -u elastic:SuperSecretElasticPassword http://localhost:9200/_cluster/health | grep -E '\"status\":\"(green|yellow)\"'",
183+
]
184+
interval: 10s
185+
timeout: 5s
186+
retries: 20
187+
start_period: 60s
178188

179189
test-cassandra-e2e-testing:
180190
image: cassandra:5.0.4
@@ -223,8 +233,9 @@ services:
223233
timeout: 10s
224234
retries: 3
225235

226-
clickhouse-e2e-testing:
227-
image: clickhouse/clickhouse-server:latest
236+
test-clickhouse-e2e-testing:
237+
image: clickhouse/clickhouse-server:24.8
238+
restart: unless-stopped
228239
ports:
229240
- 8123:8123
230241
- 9000:9000
@@ -238,10 +249,18 @@ services:
238249
soft: 262144
239250
hard: 262144
240251
healthcheck:
241-
test: ["CMD", "wget", "--spider", "-q", "http://localhost:8123/ping"]
242-
interval: 30s
243-
timeout: 10s
244-
retries: 3
252+
test:
253+
[
254+
"CMD",
255+
"clickhouse-client",
256+
"--user=default",
257+
"--password=clickhouse_password",
258+
"--query=SELECT 1",
259+
]
260+
interval: 10s
261+
timeout: 5s
262+
retries: 20
263+
start_period: 60s
245264

246265
# === Postgres Proxy E2E Testing ===
247266

@@ -453,10 +472,10 @@ services:
453472
- ./rocketadmin-agent/src:/app/src
454473
links:
455474
- autoadmin-ws-server
456-
- clickhouse-e2e-testing
475+
- test-clickhouse-e2e-testing
457476
depends_on:
458477
- autoadmin-ws-server
459-
- clickhouse-e2e-testing
478+
- test-clickhouse-e2e-testing
460479
environment:
461480
- REMOTE_WEBSOCKET_ADDRESS=ws://autoadmin-ws-server:8009
462481
- APPLICATION_CONFIG_FILE_NAME=.clickhouse_test_agent_config.txt

rocketadmin-agent/.clickhouse_test_agent_config.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"azure_encryption": false,
77
"cert": null,
88
"database": "testdb",
9-
"host": "clickhouse-e2e-testing",
9+
"host": "test-clickhouse-e2e-testing",
1010
"password": "clickhouse_password",
1111
"port": 8123,
1212
"token": "CLICKHOUSE-TEST-AGENT-TOKEN",

0 commit comments

Comments
 (0)