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/project#2556): implement patch notification for failure scenarios #492

Merged
merged 32 commits into from
Feb 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
0f336a9
feat: add tests for RESERVED_ABORTED notification handler
lewisdaly Nov 15, 2021
45f2b8b
chore: clean up old commands in package.json
lewisdaly Nov 15, 2021
59781dd
chore(refactor): clean up old scripts and dockerfiles no longer used
lewisdaly Nov 15, 2021
9404b47
feat(integration): cleaning up integration runner
lewisdaly Nov 15, 2021
ea9cfd1
feat(integration): cleaning up integration runner
lewisdaly Nov 15, 2021
2a5f849
feat: cleanup integration runner
lewisdaly Nov 15, 2021
97d6a23
feat: cleanup integration runner
lewisdaly Nov 16, 2021
77e09f2
chore(refactor): clean up deprecated integration runner
lewisdaly Nov 16, 2021
f4c4fba
chore(refactor): clean up deprecated integration runner
lewisdaly Nov 16, 2021
c1e7a04
chore(docs): update readme testing section
lewisdaly Nov 16, 2021
6ddb924
fix: disable parse-strings-in-objects for config.js as it results in …
lewisdaly Nov 16, 2021
669bf27
feat: reenable other notification tests
lewisdaly Nov 16, 2021
031a46b
feat: integration tests passing locally now
lewisdaly Nov 16, 2021
6302601
fix(ci): add nvm config
lewisdaly Nov 16, 2021
61713f4
fix(ci): add nvm config
lewisdaly Nov 16, 2021
370fd08
fix(ci): health checks seem flaky, wait a little longer before starting
lewisdaly Nov 16, 2021
1ce886d
fix(ci): health checks seem flaky, wait a little longer before starting
lewisdaly Nov 16, 2021
191cf2a
fix(ci): health checks seem flaky, wait a little longer before starting
lewisdaly Nov 16, 2021
805b091
fix(ci): health checks seem flaky, wait a little longer before starting
lewisdaly Nov 16, 2021
63d3d47
chore(deps): temporarily update central-services-shared to working br…
lewisdaly Nov 16, 2021
dfdadcd
Merge branch 'feat/2553-patch-notification' of github.com:vessels-tec…
mdebarros Feb 8, 2022
14306ae
chore: updated dependencies
mdebarros Feb 8, 2022
db2143f
fixed lint issues
mdebarros Feb 8, 2022
a6bb812
fixes for unit tests
mdebarros Feb 8, 2022
17261e8
uncommented unit tests
mdebarros Feb 9, 2022
bc1096d
updated dependencies + fixed audit issues
mdebarros Feb 10, 2022
2eb9842
fix(#2697): Central-Ledger Fulfil Handler does not correctly invalida…
mdebarros Feb 16, 2022
730446a
minor update to unit test to increase reliability
mdebarros Feb 17, 2022
f9601d5
updated dependencies & fixed audit-resolve issues
mdebarros Feb 17, 2022
f4ac448
updates for review comments - removed todo, and minor fix on metric
mdebarros Feb 18, 2022
861c947
fixes for unit tests
mdebarros Feb 22, 2022
339aba5
added comment
mdebarros Feb 22, 2022
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
32 changes: 28 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,38 @@ jobs:
executor: default-machine
steps:
- checkout
- restore_cache:
key: dependency-cache-{{ .Environment.CIRCLE_SHA1 }}
- run:
name: Create dir for test results
command: mkdir -p ./test/results
- run:
name: Execute integration tests
command: npm -s run test:integration
name: Set up nvm
command: |
echo ${NVM_DIR}
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
nvm install v12.16.1
nvm alias default v12.16.1
npm ci
- run:
name: Build and start the docker containers
command: |
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
docker-compose build
docker-compose pull
docker-compose up -d

# 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: Run the integration tests
command: |
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
curl localhost:3000/health
npm run test:int
environment:
ENDPOINT_URL: http://localhost:4545/notification
- store_artifacts:
path: ./test/results
prefix: test
Expand Down
1 change: 0 additions & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ EVENT_SDK_TRACESTATE_HEADER_ENABLED="true"
EVENT_SDK_ASYNC_OVERRIDE_EVENTS="log, trace"
EVENT_SDK_TRACEID_PER_VENDOR="false"
MLAPI_STRIP_UNKNOWN_HEADERS="true"
LIB_RESOURCE_VERSIONS="transfers=1.1,participants=1.1"
MLAPI_ENDPOINT_SOURCE_URL="http://localhost:4545"
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,27 @@ Logs are sent to standard output by default.

## Tests

Tests include unit, functional, and integration.
Take a look at the `package.json` file for a full list of the tests available.

Running the tests:
### Unit Tests

```bash
npm run test:unit
```

npm run test:all
### Integration Tests

```bash
# start docker-compose dependencies
docker-compose up -d

Tests include code coverage via istanbul. See the test/ folder for testing scripts.
# wait for docker compoments to start
npm run wait-4-docker

# run the integration tests locally
export ENDPOINT_URL=http://localhost:4545/notification
npm run test:int
```

## Auditing Dependencies

Expand Down
106 changes: 72 additions & 34 deletions audit-resolve.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,93 +51,131 @@
},
"1004854|00unidentified>widdershins>openapi-sampler>json-pointer": {
"decision": "ignore",
"madeAt": 1637938614991,
"expiresAt": 1640530606459
"madeAt": 1644323740508,
"expiresAt": 1646915719714
},
"1004869|00unidentified>widdershins>swagger2openapi>better-ajv-errors>jsonpointer": {
"decision": "ignore",
"madeAt": 1637938616674,
"expiresAt": 1640530606459
"madeAt": 1644323741861,
"expiresAt": 1646915719714
},
"1004869|00unidentified>widdershins>swagger2openapi>oas-validator>better-ajv-errors>jsonpointer": {
"decision": "ignore",
"madeAt": 1637938616674,
"expiresAt": 1640530606459
"madeAt": 1644323741862,
"expiresAt": 1646915719714
},
"1004876|hapi-swagger>swagger-parser>z-schema>validator": {
"decision": "ignore",
"madeAt": 1637938618028,
"expiresAt": 1640530606459
"madeAt": 1644323743154,
"expiresAt": 1646915719714
},
"1004946|00unidentified>widdershins>yargs>string-width>strip-ansi>ansi-regex": {
"decision": "ignore",
"madeAt": 1637938619276,
"expiresAt": 1640530606459
"madeAt": 1644323744404,
"expiresAt": 1646915719714
},
"1004946|00unidentified>widdershins>yargs>cliui>string-width>strip-ansi>ansi-regex": {
"decision": "ignore",
"madeAt": 1637938619276,
"expiresAt": 1640530606459
"madeAt": 1644323744404,
"expiresAt": 1646915719714
},
"1005383|00unidentified>shins>sanitize-html": {
"decision": "ignore",
"madeAt": 1637938620530,
"expiresAt": 1640530606459
"madeAt": 1644323745656,
"expiresAt": 1646915719714
},
"1005384|00unidentified>shins>sanitize-html": {
"decision": "ignore",
"madeAt": 1637938620530,
"expiresAt": 1640530606459
"madeAt": 1644323745656,
"expiresAt": 1646915719714
},
"1005534|00unidentified>widdershins>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1637938621785,
"expiresAt": 1640530606459
"madeAt": 1644323746860,
"expiresAt": 1646915719714
},
"1004854|@mojaloop/central-services-shared>widdershins>openapi-sampler>json-pointer": {
"decision": "ignore",
"madeAt": 1639467580396,
"expiresAt": 1642059574095
"madeAt": 1644493471030,
"expiresAt": 1647085463820
},
"1004869|@mojaloop/central-services-shared>widdershins>swagger2openapi>better-ajv-errors>jsonpointer": {
"decision": "ignore",
"madeAt": 1639467581844,
"expiresAt": 1642059574095
"madeAt": 1644493472292,
"expiresAt": 1647085463820
},
"1004869|@mojaloop/central-services-shared>widdershins>swagger2openapi>oas-validator>better-ajv-errors>jsonpointer": {
"decision": "ignore",
"madeAt": 1639467581844,
"expiresAt": 1642059574095
"madeAt": 1644493472293,
"expiresAt": 1647085463820
},
"1004946|@mojaloop/central-services-shared>widdershins>yargs>string-width>strip-ansi>ansi-regex": {
"decision": "ignore",
"madeAt": 1639467582894,
"expiresAt": 1642059574095
"madeAt": 1644493473344,
"expiresAt": 1647085463820
},
"1004946|@mojaloop/central-services-shared>widdershins>yargs>cliui>string-width>strip-ansi>ansi-regex": {
"decision": "ignore",
"madeAt": 1639467582894,
"expiresAt": 1642059574095
"madeAt": 1644493473344,
"expiresAt": 1647085463820
},
"1005383|@mojaloop/central-services-shared>shins>sanitize-html": {
"decision": "ignore",
"madeAt": 1639467583960,
"expiresAt": 1642059574095
"madeAt": 1644493474394,
"expiresAt": 1647085463820
},
"1005384|@mojaloop/central-services-shared>shins>sanitize-html": {
"decision": "ignore",
"madeAt": 1639467583960,
"expiresAt": 1642059574095
"madeAt": 1644493474394,
"expiresAt": 1647085463820
},
"1005534|@mojaloop/central-services-shared>widdershins>yargs>yargs-parser": {
"decision": "ignore",
"madeAt": 1639467585064,
"expiresAt": 1642059574095
"madeAt": 1644493475509,
"expiresAt": 1647085463820
},
"1006767|hapi-swagger>swagger-ui-dist": {
"decision": "ignore",
"madeAt": 1639467586204,
"expiresAt": 1642059574095
},
"1006899|00unidentified>widdershins>node-fetch": {
"decision": "fix",
"madeAt": 1644323736600
},
"1006899|@mojaloop/event-sdk>grpc>@mapbox/node-pre-gyp>node-fetch": {
"decision": "fix",
"madeAt": 1644323736600
},
"1006846|00unidentified>shins>sanitize-html>postcss": {
"decision": "ignore",
"madeAt": 1644323748057,
"expiresAt": 1646915719714
},
"1006886|00unidentified>shins>markdown-it": {
"decision": "ignore",
"madeAt": 1644323749219,
"expiresAt": 1646915719714
},
"1006904|hapi-swagger>swagger-ui-dist": {
"decision": "ignore",
"madeAt": 1644323750400,
"expiresAt": 1646915719714
},
"1006846|@mojaloop/central-services-shared>shins>sanitize-html>postcss": {
"decision": "ignore",
"madeAt": 1644493476539,
"expiresAt": 1647085463820
},
"1006886|@mojaloop/central-services-shared>shins>markdown-it": {
"decision": "ignore",
"madeAt": 1644493477610,
"expiresAt": 1647085463820
},
"1007017|@mojaloop/central-services-shared>widdershins>swagger2openapi>oas-validator>ajv": {
"decision": "ignore",
"madeAt": 1645104323030,
"expiresAt": 1647696313138
}
},
"rules": {},
Expand Down
6 changes: 3 additions & 3 deletions config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"queue.buffering.max.messages": 10000000
},
"topicConf": {
"request.required.acks": "all",
"request.required.acks": "1",
"partitioner": "murmur2_random"
}
}
Expand All @@ -129,7 +129,7 @@
"queue.buffering.max.messages": 10000000
},
"topicConf": {
"request.required.acks": "all",
"request.required.acks": "1",
"partitioner": "murmur2_random"
}
}
Expand All @@ -148,7 +148,7 @@
"queue.buffering.max.messages": 10000000
},
"topicConf": {
"request.required.acks": "all",
"request.required.acks": "1",
"partitioner": "murmur2_random"
}
}
Expand Down
29 changes: 0 additions & 29 deletions docker-compose.integration.yml

This file was deleted.

Loading