Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(mojaloop/#3817): harden fx quotes #345

Merged
merged 31 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
f7826b3
feat: add metrics for fx quotes
oderayi Aug 5, 2024
8a57e4d
chore: merge
oderayi Aug 5, 2024
fd4f935
refactor: minor refactor
oderayi Aug 6, 2024
2b0b45e
ci: update redis-cluster config for cross env dev, refactor for envCo…
oderayi Aug 6, 2024
eb25f71
test: disable in-progress test
oderayi Aug 6, 2024
0e64a87
ci: fix redis-cluster config
oderayi Aug 7, 2024
0cb5c62
ci: update ci script
oderayi Aug 7, 2024
f6e6eac
ci: update env scripts
oderayi Aug 7, 2024
9430eec
test: add unit tests for fxQuotes model
oderayi Aug 7, 2024
93db5d4
refactor: dedup tests
oderayi Aug 8, 2024
214954b
test: update tests
oderayi Aug 8, 2024
bd1c0eb
test: update quotes unit test
oderayi Aug 8, 2024
30ef753
test: update unit tests for quotes model, init and quoting handler
oderayi Aug 8, 2024
1a3f789
chore: remove commented block
oderayi Aug 8, 2024
c816698
test: update tests
oderayi Aug 9, 2024
687b926
chore: merge and resolve conflicts
oderayi Aug 19, 2024
e20eb0c
test: add dto for fxquotes payload
oderayi Aug 19, 2024
2f044a5
test: update integration tests for fxquotes
oderayi Aug 19, 2024
dd5299d
test: update integration tests
oderayi Aug 19, 2024
0e710ed
test: add retry logic to tests
oderayi Aug 19, 2024
e22b0c1
test: simplify retry conf
oderayi Aug 19, 2024
ecbe367
test: refactor tests
oderayi Aug 19, 2024
17a0203
refactor: minor refactor
oderayi Aug 19, 2024
bc21082
ci: remove debug run
oderayi Aug 19, 2024
adc18c2
chore: merge and resolve conflicts
oderayi Aug 20, 2024
68a3a80
test: update fxquotes test - persistent mode
oderayi Aug 20, 2024
3a4d43a
test: update put quotes test - persistent mode
oderayi Aug 20, 2024
318b626
test: update post quotes test - persistent mode
oderayi Aug 20, 2024
d97ec77
chore: linting
oderayi Aug 20, 2024
3a5cad9
test: refactor
oderayi Aug 20, 2024
9880738
chore
oderayi Aug 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -281,19 +281,6 @@ jobs:
- run:
name: Create dir for test results
command: mkdir -p ./test/results
# - run:
# name: Build and start the docker containers
# command: |
# ## This is not needed as we are only doing narrow-integration tests.
# # docker-compose build
# ## Lets pull only the Services needed for the Integration Test
# docker-compose pull mysql kafka init-kafka
# ## Lets startup only the Services needed for the Integration Test
# docker-compose up -d mysql kafka init-kafka
# ## Check straight away to see if any containers have exited
# docker-compose ps
# ## wait for services to be up and running
# npm run wait-4-docker
- run:
name: Prepare test environment
command: |
Expand All @@ -305,13 +292,6 @@ jobs:
command: |
npm rebuild
npm run test:int
# environment:
# ENDPOINT_URL: http://localhost:4545/notification
# - store_artifacts:
# path: ./test/results
# destination: test
# - store_test_results:
# path: ./test/results

vulnerability-check:
executor: default-docker
Expand Down
2 changes: 1 addition & 1 deletion .ncurc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ reject: [
"json-rules-engine",
"eslint",
"@mojaloop/sdk-standard-components", # Version 17.4.0 introduced the bug: this.logger.isDebugEnabled is not a function
"@mojaloop/central-services-shared" # This should be removed as soon as all vlaidations on the fx feature has been completed and cs-shared fx feature merged to masin
"@mojaloop/central-services-shared" # This should be removed as soon as all validations on the fx feature has been completed and cs-shared fx feature merged to main
]
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ ARG NODE_VERSION=lts-alpine
#

# Build Image
FROM node:${NODE_VERSION} as builder
FROM node:${NODE_VERSION} AS builder
USER root

WORKDIR /opt/app
Expand Down
41 changes: 34 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: "3.7"

x-depends-on: &dependsOnMysqlAndKafka
mysql:
condition: service_healthy
Expand All @@ -26,17 +24,23 @@ x-quoting-service: &quotingServiceBase
- ./secrets/:/opt/app/secrets/
depends_on:
<<: *dependsOnMysqlAndKafka
extra_hosts:
- "redis-node-0:host-gateway"
# central-ledger:
# condition: service_healthy # to perform test dfsp onboarding

# @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_NODES: redis-node-0 redis-node-1 redis-node-2 redis-node-3 redis-node-4 redis-node-5
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
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
timeout: 2s
network_mode: host

x-healthcheck-params: &healthcheckParams
interval: 30s
Expand All @@ -56,7 +60,7 @@ services:

quoting-service-handler:
<<: *quotingServiceBase
command: npm run start:handlers
command: npm run start:handlers:debug
ports:
- "3003:3003"
- "29229:9229"
Expand Down Expand Up @@ -114,25 +118,48 @@ services:
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"

redis-node-1:
<<: *REDIS_NODE
environment:
<<: *REDIS_ENVS
REDIS_PORT_NUMBER: 6380
ports:
- "16380:16380"
redis-node-2:
<<: *REDIS_NODE
environment:
<<: *REDIS_ENVS
REDIS_PORT_NUMBER: 6381
ports:
- "16381:16381"
redis-node-3:
<<: *REDIS_NODE
environment:
<<: *REDIS_ENVS
REDIS_PORT_NUMBER: 6382
ports:
- "16382:16382"
redis-node-4:
<<: *REDIS_NODE
environment:
<<: *REDIS_ENVS
REDIS_PORT_NUMBER: 6383
ports:
- "16383:16383"
redis-node-5:
<<: *REDIS_NODE
environment:
<<: *REDIS_ENVS
REDIS_PORT_NUMBER: 6384
ports:
- "16384:16384"

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