Skip to content

Commit c1f22b1

Browse files
committed
Replay test for continue as new
1 parent 50c6793 commit c1f22b1

File tree

4 files changed

+1622
-2
lines changed

4 files changed

+1622
-2
lines changed

docker-compose.yml

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
version: '3'
2+
services:
3+
cassandra:
4+
image: cassandra:4.1.1
5+
ports:
6+
- "9042:9042"
7+
environment:
8+
- "MAX_HEAP_SIZE=256M"
9+
- "HEAP_NEWSIZE=128M"
10+
healthcheck:
11+
test: ["CMD", "cqlsh", "-u cassandra", "-p cassandra" ,"-e describe keyspaces"]
12+
interval: 15s
13+
timeout: 30s
14+
retries: 10
15+
prometheus:
16+
image: prom/prometheus:latest
17+
volumes:
18+
- ./prometheus:/etc/prometheus
19+
command:
20+
- '--config.file=/etc/prometheus/prometheus.yml'
21+
ports:
22+
- '9090:9090'
23+
node-exporter:
24+
image: prom/node-exporter
25+
ports:
26+
- '9100:9100'
27+
cadence:
28+
image: ubercadence/server:master-auto-setup
29+
ports:
30+
- "8000:8000"
31+
- "8001:8001"
32+
- "8002:8002"
33+
- "8003:8003"
34+
- "7933:7933"
35+
- "7934:7934"
36+
- "7935:7935"
37+
- "7939:7939"
38+
- "7833:7833"
39+
environment:
40+
- "CASSANDRA_SEEDS=cassandra"
41+
- "PROMETHEUS_ENDPOINT_0=0.0.0.0:8000"
42+
- "PROMETHEUS_ENDPOINT_1=0.0.0.0:8001"
43+
- "PROMETHEUS_ENDPOINT_2=0.0.0.0:8002"
44+
- "PROMETHEUS_ENDPOINT_3=0.0.0.0:8003"
45+
- "DYNAMIC_CONFIG_FILE_PATH=config/dynamicconfig/development.yaml"
46+
- "LOG_LEVEL=debug"
47+
depends_on:
48+
cassandra:
49+
condition: service_healthy
50+
prometheus:
51+
condition: service_started
52+
cadence-web:
53+
image: ubercadence/web:latest
54+
environment:
55+
- "CADENCE_TCHANNEL_PEERS=cadence:7933"
56+
ports:
57+
- "8088:8088"
58+
depends_on:
59+
- cadence
60+
grafana:
61+
image: grafana/grafana
62+
volumes:
63+
- ./grafana:/etc/grafana
64+
user: "1000"
65+
depends_on:
66+
- prometheus
67+
ports:
68+
- '3000:3000'

src/test/java/com/uber/cadence/samples/hello/HelloActivityReplayTest.java renamed to src/test/java/com/uber/cadence/samples/replaytests/HelloActivityReplayTest.java

+13-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@
1515
* permissions and limitations under the License.
1616
*/
1717

18-
package com.uber.cadence.samples.hello;
18+
package com.uber.cadence.samples.replaytests;
1919

20+
import com.uber.cadence.samples.hello.HelloActivity;
21+
import com.uber.cadence.samples.hello.HelloPeriodic;
2022
import com.uber.cadence.testing.WorkflowReplayer;
2123
import org.junit.Test;
2224

@@ -28,9 +30,18 @@
2830
// Or from Cadence Web UI. (You may need to put history file in resources folder; and change
2931
// workflowType in the first event of history).
3032
public class HelloActivityReplayTest {
33+
34+
//simple replayer test which checks the current workflow execution with the definition: should pass
3135
@Test
3236
public void testReplay() throws Exception {
3337
WorkflowReplayer.replayWorkflowExecutionFromResource(
34-
"HelloActivity.json", HelloActivity.GreetingWorkflowImpl.class);
38+
"replaytests/HelloActivity.json", HelloActivity.GreetingWorkflowImpl.class);
39+
}
40+
41+
//continue-as-new case for replayer tests
42+
@Test
43+
public void testReplay_continueAsNew() throws Exception {
44+
WorkflowReplayer.replayWorkflowExecutionFromResource(
45+
"replaytests/HelloPeriodic.json", HelloPeriodic.GreetingWorkflowImpl.class);
3546
}
3647
}

0 commit comments

Comments
 (0)