Skip to content

Commit ff71677

Browse files
committed
Fix scripts to run from any directory and simplify CDC pipeline config
Co-authored by Claude Code
1 parent b9248c0 commit ff71677

4 files changed

Lines changed: 12 additions & 32 deletions

File tree

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
**/.hitl
12
.gradle
23
build/
34
*.idea/
@@ -15,5 +16,3 @@ bin
1516
node_modules
1617
dist
1718
ftgo-api-gateway-graphql/jest_0
18-
.claude/issues
19-
.claude/sessions

ftgo-end-to-end-tests/src/endToEndTest/java/net/chrisrichardson/ftgo/endtoendtests/ApplicationUnderTestUsingTestContainers.java

Lines changed: 6 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -90,26 +90,19 @@ public ApplicationUnderTestUsingTestContainers() {
9090
apiGateway = createApiGatewayContainer();
9191

9292
// CDC service
93-
// Note: Accounting service needs BOTH pipelines:
94-
// - Tram pipeline (message table) for sending saga replies
95-
// - EventuateLocal pipeline (events table) for publishing domain events
96-
// Both pipelines share the same reader (reader5)
9793
cdc = new EventuateCdcContainer()
9894
.withKafka(kafka)
9995
.withKafkaLeadership()
100-
.withTramPipeline(consumerDatabase) // reader1, pipeline1
101-
.withTramPipeline(orderDatabase) // reader2, pipeline2
102-
.withTramPipeline(kitchenDatabase) // reader3, pipeline3
103-
.withTramPipeline(restaurantDatabase) // reader4, pipeline4
104-
.withTramPipeline(accountingDatabase) // reader5, pipeline5 (Tram for saga replies)
105-
.withTramPipeline(deliveryDatabase) // reader6, pipeline6
96+
.withTramPipeline(consumerDatabase)
97+
.withTramPipeline(orderDatabase)
98+
.withTramPipeline(kitchenDatabase)
99+
.withTramPipeline(restaurantDatabase)
100+
.withTramAndLocalPipeline(accountingDatabase)
101+
.withTramPipeline(deliveryDatabase)
106102
.withReuse(false)
107103
.withExposedPorts(8080)
108104
.dependsOn(consumerService, orderService, kitchenService, restaurantService, accountingService, deliveryService)
109105
.withLogConsumer(new Slf4jLogConsumer(logger).withPrefix("cdc:"));
110-
111-
// Add EventuateLocal pipeline for accounting service (reuses reader5, new pipeline7)
112-
addEventuateLocalPipelineUsingExistingReader(cdc, 5, 7);
113106
}
114107

115108
private EventuateDatabaseContainer<?> createDatabase(String alias) {
@@ -171,20 +164,6 @@ private GenericContainer<?> createApiGatewayContainer() {
171164
.withLogConsumer(new Slf4jLogConsumer(logger).withPrefix("api-gateway:"));
172165
}
173166

174-
/**
175-
* Adds an EventuateLocal pipeline that reuses an existing reader.
176-
* This allows the same database to have both Tram and EventuateLocal pipelines.
177-
*/
178-
private void addEventuateLocalPipelineUsingExistingReader(EventuateCdcContainer cdc, int readerIdx, int pipelineIdx) {
179-
String pipelinePrefix = "EVENTUATE_CDC_PIPELINE_PIPELINE" + pipelineIdx + "_";
180-
181-
// Pipeline configuration - uses eventuate-local type and existing reader
182-
// Note: accounting-service uses schema=public (per its application.properties)
183-
cdc.withEnv(pipelinePrefix + "TYPE", "eventuate-local");
184-
cdc.withEnv(pipelinePrefix + "READER", "reader" + readerIdx);
185-
cdc.withEnv(pipelinePrefix + "EVENTUATEDATABASESCHEMA", "public");
186-
}
187-
188167
@Override
189168
public void start() {
190169
kafka.withLogConsumer(new Slf4jLogConsumer(logger).withPrefix("kafka:"));

run-end-to-end-tests-using-test-containers.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
set -e
44

5+
cd "$(dirname "$0")/ftgo-end-to-end-tests"
6+
57
echo "Running end-to-end tests using TestContainers..."
68
echo ""
79

8-
cd ftgo-end-to-end-tests
9-
1010
./gradlew cleanEndToEndTest
1111
./gradlew endToEndTest -PendToEndTestMode=TestContainers "$@"
1212

run-end-to-end-tests.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
#! /bin/bash -e
22

3-
./gradlew :ftgo-end-to-end-tests:cleanTest :ftgo-end-to-end-tests:test
3+
cd "$(dirname "$0")/ftgo-end-to-end-tests"
4+
5+
./gradlew cleanTest test

0 commit comments

Comments
 (0)