Skip to content

Commit

Permalink
fix: duplicate fx transfers (#1097)
Browse files Browse the repository at this point in the history
* fix: int tests

* fix: int tests

* fix: audit and lint fix

* fix: spelling

* chore: skipped an int test

* chore(snapshot): 17.8.0-snapshot.17

* chore(snapshot): 17.8.0-snapshot.18

* chore(snapshot): 17.8.0-snapshot.19

* chore(snapshot): 17.8.0-snapshot.20

* fix: add duplication logic and test for fxTransfers

* conversionState

* alter int test for message key 0

* alter test

---------

Co-authored-by: Kevin Leyow <[email protected]>
  • Loading branch information
vijayg10 and kleyow authored Sep 12, 2024
1 parent 3cae6f2 commit 33f765d
Show file tree
Hide file tree
Showing 14 changed files with 920 additions and 529 deletions.
11 changes: 7 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,8 @@ If you want to run integration tests in a repetitive manner, you can startup the
Start containers required for Integration Tests

```bash
docker-compose -f docker-compose.yml up -d mysql kafka init-kafka kafka-debug-console redis
source ./docker/env.sh
docker compose up -d mysql kafka init-kafka redis-node-0 redis-node-1 redis-node-2 redis-node-3 redis-node-4 redis-node-5
```

Run wait script which will report once all required containers are up and running
Expand Down Expand Up @@ -226,7 +227,8 @@ If you want to run integration tests in a repetitive manner, you can startup the
Start containers required for Integration Tests, including a `central-ledger` container which will be used as a proxy shell.

```bash
docker-compose -f docker-compose.yml -f docker-compose.integration.yml up -d kafka mysql central-ledger
source ./docker/env.sh
docker-compose -f docker-compose.yml -f docker-compose.integration.yml up -d kafka mysql central-ledger init-kafka redis-node-0 redis-node-1 redis-node-2 redis-node-3 redis-node-4 redis-node-5
```

Run the Integration Tests from the `central-ledger` container
Expand All @@ -241,8 +243,9 @@ If you want to run override position topic tests you can repeat the above and us

#### For running integration tests for batch processing interactively
- Run dependecies
```
docker-compose up -d mysql kafka init-kafka kafka-debug-console redis
```bash
source ./docker/env.sh
docker compose up -d mysql kafka init-kafka redis-node-0 redis-node-1 redis-node-2 redis-node-3 redis-node-4 redis-node-5
npm run wait-4-docker
```
- Run central-ledger services
Expand Down
43 changes: 22 additions & 21 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@ networks:
cl-mojaloop-net:
name: cl-mojaloop-net


# @see https://uninterrupted.tech/blog/hassle-free-redis-cluster-deployment-using-docker/
x-redis-node: &REDIS_NODE
image: docker.io/bitnami/redis-cluster:6.2.14
environment: &REDIS_ENVS
ALLOW_EMPTY_PASSWORD: yes
REDIS_CLUSTER_DYNAMIC_IPS: no
REDIS_CLUSTER_ANNOUNCE_IP: ${REDIS_CLUSTER_ANNOUNCE_IP}
REDIS_NODES: localhost:6379 localhost:6380 localhost:6381 localhost:6382 localhost:6383 localhost:6384
REDIS_NODES: redis-node-0:6379 redis-node-1:9301 redis-node-2:9302 redis-node-3:9303 redis-node-4:9304 redis-node-5:9305
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
timeout: 2s
network_mode: host
networks:
- cl-mojaloop-net

services:
central-ledger:
Expand Down Expand Up @@ -112,57 +114,56 @@ services:

redis-node-0:
<<: *REDIS_NODE
container_name: cl_redis-node-0
environment:
<<: *REDIS_ENVS
REDIS_CLUSTER_CREATOR: yes
REDIS_PORT_NUMBER: 6379
depends_on:
- redis-node-1
- redis-node-2
- redis-node-3
- redis-node-4
- redis-node-5
ports:
- "6379:6379"
- "16379:16379"
redis-node-1:
<<: *REDIS_NODE
container_name: cl_redis-node-1
environment:
<<: *REDIS_ENVS
REDIS_PORT_NUMBER: 6380
REDIS_PORT_NUMBER: 9301
ports:
- "16380:16380"
- "9301:9301"
- "19301:19301"
redis-node-2:
<<: *REDIS_NODE
container_name: cl_redis-node-2
environment:
<<: *REDIS_ENVS
REDIS_PORT_NUMBER: 6381
REDIS_PORT_NUMBER: 9302
ports:
- "16381:16381"
- "9302:9302"
- "19302:19302"
redis-node-3:
<<: *REDIS_NODE
container_name: cl_redis-node-3
environment:
<<: *REDIS_ENVS
REDIS_PORT_NUMBER: 6382
REDIS_PORT_NUMBER: 9303
ports:
- "16382:16382"
- "9303:9303"
- "19303:19303"
redis-node-4:
<<: *REDIS_NODE
container_name: cl_redis-node-4
environment:
<<: *REDIS_ENVS
REDIS_PORT_NUMBER: 6383
REDIS_PORT_NUMBER: 9304
ports:
- "16383:16383"
- "9304:9304"
- "19304:19304"
redis-node-5:
<<: *REDIS_NODE
container_name: cl_redis-node-5
environment:
<<: *REDIS_ENVS
REDIS_PORT_NUMBER: 6384
REDIS_PORT_NUMBER: 9305
ports:
- "16384:16384"
- "9305:9305"
- "19305:19305"

## To be used with proxyCache.type === 'redis'
# redis:
Expand Down
Loading

0 comments on commit 33f765d

Please sign in to comment.