From 8283d531f6970f3abbe59720d26ce49dcf80eb10 Mon Sep 17 00:00:00 2001 From: hsiegeln <37154749+hsiegeln@users.noreply.github.com> Date: Tue, 21 Apr 2026 22:22:34 +0200 Subject: [PATCH] fix(test): restore CH pipeline + read ITs after schema collapse MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ClickHouseChunkPipelineIT.setUp was loading /clickhouse/V2__executions.sql and /clickhouse/V3__processor_executions.sql — resource paths that no longer exist after 90083f88 collapsed the V1..V18 ClickHouse schema into init.sql. Swapped for ClickHouseTestHelper.executeInitSql(jdbc). ClickHouseExecutionReadIT.detailService_buildTree_withIterations was asserting getLoopIndex() on children of a split, but DetailService's seq-based buildTree path (buildTreeBySeq) maps FlatProcessorRecord.iteration into ProcessorNode.iteration — not loopIndex. The loopIndex path is only populated by buildTreeByProcessorId (the legacy ID-only fallback). Switched the assertion to getIteration() to match the seq-driven reconstruction. Co-Authored-By: Claude Opus 4.7 (1M context) --- .../server/app/storage/ClickHouseChunkPipelineIT.java | 9 ++------- .../server/app/storage/ClickHouseExecutionReadIT.java | 10 ++++++---- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/cameleer-server-app/src/test/java/com/cameleer/server/app/storage/ClickHouseChunkPipelineIT.java b/cameleer-server-app/src/test/java/com/cameleer/server/app/storage/ClickHouseChunkPipelineIT.java index a687ea94..4cb4c3fd 100644 --- a/cameleer-server-app/src/test/java/com/cameleer/server/app/storage/ClickHouseChunkPipelineIT.java +++ b/cameleer-server-app/src/test/java/com/cameleer/server/app/storage/ClickHouseChunkPipelineIT.java @@ -19,7 +19,6 @@ import org.testcontainers.junit.jupiter.Container; import org.testcontainers.junit.jupiter.Testcontainers; import java.io.IOException; -import java.nio.charset.StandardCharsets; import java.time.Duration; import java.time.Instant; import java.util.ArrayList; @@ -50,12 +49,8 @@ class ClickHouseChunkPipelineIT { ds.setPassword(clickhouse.getPassword()); jdbc = new JdbcTemplate(ds); - String execDdl = new String(getClass().getResourceAsStream( - "/clickhouse/V2__executions.sql").readAllBytes(), StandardCharsets.UTF_8); - String procDdl = new String(getClass().getResourceAsStream( - "/clickhouse/V3__processor_executions.sql").readAllBytes(), StandardCharsets.UTF_8); - jdbc.execute(execDdl); - jdbc.execute(procDdl); + // Schema files were collapsed into clickhouse/init.sql. + com.cameleer.server.app.ClickHouseTestHelper.executeInitSql(jdbc); jdbc.execute("TRUNCATE TABLE executions"); jdbc.execute("TRUNCATE TABLE processor_executions"); diff --git a/cameleer-server-app/src/test/java/com/cameleer/server/app/storage/ClickHouseExecutionReadIT.java b/cameleer-server-app/src/test/java/com/cameleer/server/app/storage/ClickHouseExecutionReadIT.java index 19ac9aa2..20c6051b 100644 --- a/cameleer-server-app/src/test/java/com/cameleer/server/app/storage/ClickHouseExecutionReadIT.java +++ b/cameleer-server-app/src/test/java/com/cameleer/server/app/storage/ClickHouseExecutionReadIT.java @@ -239,9 +239,11 @@ class ClickHouseExecutionReadIT { assertThat(children).hasSize(3); assertThat(children).allMatch(c -> "to-1".equals(c.getProcessorId())); - // Verify iteration values via getLoopIndex() (iteration maps to loopIndex in the seq-based path) - assertThat(children.get(0).getLoopIndex()).isEqualTo(0); - assertThat(children.get(1).getLoopIndex()).isEqualTo(1); - assertThat(children.get(2).getLoopIndex()).isEqualTo(2); + // The seq-based buildTree path (DetailService.buildTreeBySeq) copies + // FlatProcessorRecord.iteration into ProcessorNode.iteration directly. + // The processorId-based path is what projects into loopIndex. + assertThat(children.get(0).getIteration()).isEqualTo(0); + assertThat(children.get(1).getIteration()).isEqualTo(1); + assertThat(children.get(2).getIteration()).isEqualTo(2); } }