fix(test): restore CH pipeline + read ITs after schema collapse

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) <noreply@anthropic.com>
This commit is contained in:
hsiegeln
2026-04-21 22:22:34 +02:00
parent d5adaaab72
commit 8283d531f6
2 changed files with 8 additions and 11 deletions

View File

@@ -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");

View File

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