Skip to content

Commit

Permalink
Replay test for continue as new
Browse files Browse the repository at this point in the history
  • Loading branch information
abhishekj720 committed May 21, 2024
1 parent 50c6793 commit c1f22b1
Show file tree
Hide file tree
Showing 4 changed files with 1,622 additions and 2 deletions.
68 changes: 68 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
version: '3'
services:
cassandra:
image: cassandra:4.1.1
ports:
- "9042:9042"
environment:
- "MAX_HEAP_SIZE=256M"
- "HEAP_NEWSIZE=128M"
healthcheck:
test: ["CMD", "cqlsh", "-u cassandra", "-p cassandra" ,"-e describe keyspaces"]
interval: 15s
timeout: 30s
retries: 10
prometheus:
image: prom/prometheus:latest
volumes:
- ./prometheus:/etc/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
ports:
- '9090:9090'
node-exporter:
image: prom/node-exporter
ports:
- '9100:9100'
cadence:
image: ubercadence/server:master-auto-setup
ports:
- "8000:8000"
- "8001:8001"
- "8002:8002"
- "8003:8003"
- "7933:7933"
- "7934:7934"
- "7935:7935"
- "7939:7939"
- "7833:7833"
environment:
- "CASSANDRA_SEEDS=cassandra"
- "PROMETHEUS_ENDPOINT_0=0.0.0.0:8000"
- "PROMETHEUS_ENDPOINT_1=0.0.0.0:8001"
- "PROMETHEUS_ENDPOINT_2=0.0.0.0:8002"
- "PROMETHEUS_ENDPOINT_3=0.0.0.0:8003"
- "DYNAMIC_CONFIG_FILE_PATH=config/dynamicconfig/development.yaml"
- "LOG_LEVEL=debug"
depends_on:
cassandra:
condition: service_healthy
prometheus:
condition: service_started
cadence-web:
image: ubercadence/web:latest
environment:
- "CADENCE_TCHANNEL_PEERS=cadence:7933"
ports:
- "8088:8088"
depends_on:
- cadence
grafana:
image: grafana/grafana
volumes:
- ./grafana:/etc/grafana
user: "1000"
depends_on:
- prometheus
ports:
- '3000:3000'
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@
* permissions and limitations under the License.
*/

package com.uber.cadence.samples.hello;
package com.uber.cadence.samples.replaytests;

import com.uber.cadence.samples.hello.HelloActivity;
import com.uber.cadence.samples.hello.HelloPeriodic;
import com.uber.cadence.testing.WorkflowReplayer;
import org.junit.Test;

Expand All @@ -28,9 +30,18 @@
// Or from Cadence Web UI. (You may need to put history file in resources folder; and change
// workflowType in the first event of history).
public class HelloActivityReplayTest {

//simple replayer test which checks the current workflow execution with the definition: should pass
@Test
public void testReplay() throws Exception {
WorkflowReplayer.replayWorkflowExecutionFromResource(
"HelloActivity.json", HelloActivity.GreetingWorkflowImpl.class);
"replaytests/HelloActivity.json", HelloActivity.GreetingWorkflowImpl.class);
}

//continue-as-new case for replayer tests
@Test
public void testReplay_continueAsNew() throws Exception {
WorkflowReplayer.replayWorkflowExecutionFromResource(
"replaytests/HelloPeriodic.json", HelloPeriodic.GreetingWorkflowImpl.class);
}
}
File renamed without changes.
Loading

0 comments on commit c1f22b1

Please sign in to comment.