From 228ad7026a57fd37ebc1f5ef301b039eda82d94f Mon Sep 17 00:00:00 2001 From: toto Date: Wed, 8 Apr 2026 02:55:43 +0200 Subject: [PATCH] fix(integration): mount missing SQL files 10-12 in ClickHouse init MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 3 SQL files were missing from the docker-compose.yml volume mounts: - 10_perf_indexes.sql (performance indexes) - 11_views.sql (dashboard views) - 12_thesis_features.sql (thesis §5 MVs and views) Also make 10_perf_indexes.sql non-fatal in init script since ALTER TABLE ADD INDEX may fail if index already exists. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- tests/integration/docker-compose.yml | 3 +++ tests/integration/platform/clickhouse-init.sh | 11 +++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/integration/docker-compose.yml b/tests/integration/docker-compose.yml index 3c2f249..8f29bb1 100644 --- a/tests/integration/docker-compose.yml +++ b/tests/integration/docker-compose.yml @@ -37,6 +37,9 @@ services: - ../../shared/clickhouse/07_ai_features_view.sql:/initdb-src/07_ai_features_view.sql:ro - ../../shared/clickhouse/08_users.sql:/initdb-src/08_users.sql:ro - ../../shared/clickhouse/09_audit_table.sql:/initdb-src/09_audit_table.sql:ro + - ../../shared/clickhouse/10_perf_indexes.sql:/initdb-src/10_perf_indexes.sql:ro + - ../../shared/clickhouse/11_views.sql:/initdb-src/11_views.sql:ro + - ../../shared/clickhouse/12_thesis_features.sql:/initdb-src/12_thesis_features.sql:ro # Empty CSV stubs (dictionaries expect these files) - ./platform/csv-stubs:/var/lib/clickhouse/user_files ports: diff --git a/tests/integration/platform/clickhouse-init.sh b/tests/integration/platform/clickhouse-init.sh index f58e07f..89a965c 100755 --- a/tests/integration/platform/clickhouse-init.sh +++ b/tests/integration/platform/clickhouse-init.sh @@ -23,8 +23,15 @@ done for f in "$TMP_DIR"/*.sql; do [ -f "$f" ] || continue - echo "[init] Executing $(basename "$f")" - clickhouse-client --multiquery < "$f" + base=$(basename "$f") + echo "[init] Executing $base" + # 10_perf_indexes.sql uses ALTER TABLE ADD INDEX which may fail if index + # already exists — allow non-zero exit for migration/perf scripts + if [[ "$base" == 10_* ]]; then + clickhouse-client --multiquery < "$f" || echo "[init] WARNING: $base had errors (expected for duplicate indexes)" + else + clickhouse-client --multiquery < "$f" + fi done # ---------------------------------------------------------------------------