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:
@@ -19,7 +19,6 @@ import org.testcontainers.junit.jupiter.Container;
|
|||||||
import org.testcontainers.junit.jupiter.Testcontainers;
|
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.charset.StandardCharsets;
|
|
||||||
import java.time.Duration;
|
import java.time.Duration;
|
||||||
import java.time.Instant;
|
import java.time.Instant;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -50,12 +49,8 @@ class ClickHouseChunkPipelineIT {
|
|||||||
ds.setPassword(clickhouse.getPassword());
|
ds.setPassword(clickhouse.getPassword());
|
||||||
jdbc = new JdbcTemplate(ds);
|
jdbc = new JdbcTemplate(ds);
|
||||||
|
|
||||||
String execDdl = new String(getClass().getResourceAsStream(
|
// Schema files were collapsed into clickhouse/init.sql.
|
||||||
"/clickhouse/V2__executions.sql").readAllBytes(), StandardCharsets.UTF_8);
|
com.cameleer.server.app.ClickHouseTestHelper.executeInitSql(jdbc);
|
||||||
String procDdl = new String(getClass().getResourceAsStream(
|
|
||||||
"/clickhouse/V3__processor_executions.sql").readAllBytes(), StandardCharsets.UTF_8);
|
|
||||||
jdbc.execute(execDdl);
|
|
||||||
jdbc.execute(procDdl);
|
|
||||||
jdbc.execute("TRUNCATE TABLE executions");
|
jdbc.execute("TRUNCATE TABLE executions");
|
||||||
jdbc.execute("TRUNCATE TABLE processor_executions");
|
jdbc.execute("TRUNCATE TABLE processor_executions");
|
||||||
|
|
||||||
|
|||||||
@@ -239,9 +239,11 @@ class ClickHouseExecutionReadIT {
|
|||||||
assertThat(children).hasSize(3);
|
assertThat(children).hasSize(3);
|
||||||
assertThat(children).allMatch(c -> "to-1".equals(c.getProcessorId()));
|
assertThat(children).allMatch(c -> "to-1".equals(c.getProcessorId()));
|
||||||
|
|
||||||
// Verify iteration values via getLoopIndex() (iteration maps to loopIndex in the seq-based path)
|
// The seq-based buildTree path (DetailService.buildTreeBySeq) copies
|
||||||
assertThat(children.get(0).getLoopIndex()).isEqualTo(0);
|
// FlatProcessorRecord.iteration into ProcessorNode.iteration directly.
|
||||||
assertThat(children.get(1).getLoopIndex()).isEqualTo(1);
|
// The processorId-based path is what projects into loopIndex.
|
||||||
assertThat(children.get(2).getLoopIndex()).isEqualTo(2);
|
assertThat(children.get(0).getIteration()).isEqualTo(0);
|
||||||
|
assertThat(children.get(1).getIteration()).isEqualTo(1);
|
||||||
|
assertThat(children.get(2).getIteration()).isEqualTo(2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user