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); } }