Skip to content

Commit

Permalink
feat(mojaloop/3023): align ttk func tests from ttk testcases repo (#425)
Browse files Browse the repository at this point in the history
* feat: removed ttk test cases

* feat: changed the MSISDNs in rules to align with ttk test case repo

* feat: added environment for ttksim1

* feat: added a docker compose file for executing ttk testcases with CLI

* feat: enabled TTK functional tests in CICD

* chore: enabled test func in CICD

* test: fix1

* test: fix2

* test: fix3

* test: fix4

* Updates to enable payload

* Updated rules for sims and hub

* updates to kafka restart

* updates to timeout rules

* chore: bump dep

* chore: fix reporting

* chore: fix reporting

* chore: adjust timeout

Co-authored-by: Sridevi Miriyala <sridevi.miriyala@modusbox.com>
Co-authored-by: Kevin <kleyow@gmail.com>
  • Loading branch information
3 people committed Nov 24, 2022
1 parent 9680e32 commit 973faa7
Show file tree
Hide file tree
Showing 31 changed files with 676 additions and 13,163 deletions.
44 changes: 44 additions & 0 deletions .circleci/config.yml
Expand Up @@ -216,6 +216,37 @@ jobs:
# - store_test_results:
# path: ./test/results

test-func:
executor: default-machine
environment: *defaults_environment
steps:
- checkout
- run:
<<: *defaults_configure_nvm
- attach_workspace:
at: /tmp
- run:
name: Load the pre-built docker image from workspace
command: docker load -i /tmp/docker-image.tar
- run:
name: Start docker-compose for SDK and simulators
command: |
cd test/func
docker-compose up -d
- run:
name: Wait for some time
command: |
sleep 10
- run:
name: Execute Functional Tests
command: |
cd test/func
docker-compose -f ./ttk-tests-docker-compose.yml up --abort-on-container-exit
docker compose down
- store_artifacts:
path: ./test/func/reports
prefix: test

validate-openapi:
executor: default-docker
environment: *defaults_environment
Expand Down Expand Up @@ -695,6 +726,19 @@ workflows:
- /feature*/
- /bugfix*/

- test-func:
context: org-global
requires:
- setup
- build-local
filters:
tags:
only: /.*/
branches:
ignore:
- /feature*/
- /bugfix*/

- vulnerability-check:
context: org-global
requires:
Expand Down
6 changes: 5 additions & 1 deletion .ncurc.yaml
@@ -1,2 +1,6 @@
## Add a TODO comment indicating the reason for each rejected dependency upgrade added to this list, and what should be done to resolve it (i.e. handle it through a story, etc).
reject: []
reject: [
## Between version 0.2.15-0.2.21 there is a breaking change that results in a segmentation fault.
## TODO: Investigate.
'@mojaloop/platform-shared-lib-nodejs-kafka-client-lib'
]
12 changes: 6 additions & 6 deletions modules/api-svc/package.json
Expand Up @@ -63,14 +63,14 @@
"@koa/cors": "^4.0.0",
"@mojaloop/api-snippets": "17.0.0",
"@mojaloop/central-services-error-handling": "^12.0.5",
"@mojaloop/central-services-logger": "^11.0.1",
"@mojaloop/central-services-logger": "^11.2.0",
"@mojaloop/central-services-metrics": "^12.0.5",
"@mojaloop/central-services-shared": "17.3.1",
"@mojaloop/event-sdk": "^11.0.2",
"@mojaloop/sdk-scheme-adapter-private-shared-lib": "workspace:^",
"@mojaloop/sdk-standard-components": "^17.1.1",
"ajv": "8.11.2",
"axios": "^1.1.3",
"axios": "^1.2.0",
"co-body": "^6.1.0",
"dotenv": "^16.0.3",
"env-var": "^7.3.0",
Expand Down Expand Up @@ -98,16 +98,16 @@
"@redocly/openapi-cli": "^1.0.0-beta.94",
"@types/jest": "^29.2.3",
"babel-jest": "^29.3.1",
"eslint": "^8.27.0",
"eslint": "^8.28.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jest": "^27.1.5",
"jest": "^29.3.1",
"jest-junit": "^14.0.1",
"jest-junit": "^15.0.0",
"nock": "^13.2.9",
"npm-check-updates": "^16.4.1",
"npm-check-updates": "^16.4.3",
"openapi-response-validator": "^12.0.2",
"openapi-typescript": "^6.0.3",
"openapi-typescript": "^6.1.0",
"redis-mock": "^0.56.3",
"replace": "^1.2.2",
"standard-version": "^9.5.0",
Expand Down
16 changes: 8 additions & 8 deletions modules/outbound-command-event-handler/package.json
Expand Up @@ -43,13 +43,13 @@
"dependencies": {
"@mojaloop/api-snippets": "17.0.0",
"@mojaloop/central-services-shared": "^17.3.1",
"@mojaloop/logging-bc-client-lib": "^0.1.16",
"@mojaloop/logging-bc-public-types-lib": "^0.1.13",
"@mojaloop/logging-bc-client-lib": "^0.1.17",
"@mojaloop/logging-bc-public-types-lib": "^0.1.14",
"@mojaloop/sdk-scheme-adapter-private-shared-lib": "workspace:^",
"ajv": "^8.11.2",
"convict": "^6.2.3",
"express": "^4.18.2",
"openapi-backend": "^5.5.0",
"openapi-backend": "^5.6.0",
"redis": "^4.5.0",
"swagger-ui-express": "^4.6.0",
"yamljs": "^0.3.0"
Expand All @@ -63,18 +63,18 @@
"@types/supertest": "^2.0.12",
"@types/swagger-ui-express": "^4.1.3",
"@types/yamljs": "^0.2.31",
"@typescript-eslint/eslint-plugin": "^5.43.0",
"@typescript-eslint/parser": "^5.43.0",
"@typescript-eslint/eslint-plugin": "^5.44.0",
"@typescript-eslint/parser": "^5.44.0",
"copyfiles": "^2.4.1",
"eslint": "^8.27.0",
"eslint": "^8.28.0",
"jest": "^29.3.1",
"nodemon": "^2.0.20",
"npm-check-updates": "^16.4.1",
"npm-check-updates": "^16.4.3",
"replace": "^1.2.2",
"standard-version": "^9.5.0",
"ts-jest": "^29.0.3",
"ts-node": "^10.9.1",
"typescript": "^4.8.4"
"typescript": "^4.9.3"
},
"nodemonConfig": {
"watch": [
Expand Down
16 changes: 8 additions & 8 deletions modules/outbound-domain-event-handler/package.json
Expand Up @@ -42,12 +42,12 @@
},
"dependencies": {
"@mojaloop/api-snippets": "17.0.0",
"@mojaloop/logging-bc-client-lib": "^0.1.16",
"@mojaloop/logging-bc-public-types-lib": "^0.1.13",
"@mojaloop/logging-bc-client-lib": "^0.1.17",
"@mojaloop/logging-bc-public-types-lib": "^0.1.14",
"@mojaloop/sdk-scheme-adapter-private-shared-lib": "workspace:^",
"convict": "^6.2.3",
"express": "^4.18.2",
"openapi-backend": "^5.5.0",
"openapi-backend": "^5.6.0",
"redis": "^4.5.0",
"swagger-ui-express": "^4.6.0",
"yamljs": "^0.3.0"
Expand All @@ -61,18 +61,18 @@
"@types/supertest": "^2.0.12",
"@types/swagger-ui-express": "^4.1.3",
"@types/yamljs": "^0.2.31",
"@typescript-eslint/eslint-plugin": "^5.43.0",
"@typescript-eslint/parser": "^5.43.0",
"@typescript-eslint/eslint-plugin": "^5.44.0",
"@typescript-eslint/parser": "^5.44.0",
"copyfiles": "^2.4.1",
"eslint": "^8.27.0",
"eslint": "^8.28.0",
"jest": "^29.3.1",
"nodemon": "^2.0.20",
"npm-check-updates": "^16.4.1",
"npm-check-updates": "^16.4.3",
"replace": "^1.2.2",
"standard-version": "^9.5.0",
"ts-jest": "^29.0.3",
"ts-node": "^10.9.1",
"typescript": "^4.8.4"
"typescript": "^4.9.3"
},
"nodemonConfig": {
"watch": [
Expand Down
12 changes: 6 additions & 6 deletions modules/private-shared-lib/package.json
Expand Up @@ -29,22 +29,22 @@
"dependencies": {
"@mojaloop/api-snippets": "17.0.0",
"@mojaloop/central-services-shared": "^17.3.1",
"@mojaloop/logging-bc-public-types-lib": "^0.1.13",
"@mojaloop/platform-shared-lib-messaging-types-lib": "^0.2.18",
"@mojaloop/platform-shared-lib-nodejs-kafka-client-lib": "^0.2.15",
"@mojaloop/logging-bc-public-types-lib": "^0.1.14",
"@mojaloop/platform-shared-lib-messaging-types-lib": "^0.2.24",
"@mojaloop/platform-shared-lib-nodejs-kafka-client-lib": "0.2.15",
"ajv": "^8.11.2",
"redis": "^4.5.0",
"uuid": "^9.0.0"
},
"devDependencies": {
"@types/node": "^18.11.9",
"eslint": "^8.27.0",
"eslint": "^8.28.0",
"jest": "^29.3.1",
"npm-check-updates": "^16.4.1",
"npm-check-updates": "^16.4.3",
"replace": "^1.2.2",
"standard-version": "^9.5.0",
"ts-jest": "^29.0.3",
"typescript": "^4.8.4"
"typescript": "^4.9.3"
},
"standard-version": {
"scripts": {
Expand Down
12 changes: 6 additions & 6 deletions package.json
Expand Up @@ -67,28 +67,28 @@
"wait-4-docker": "node ./scripts/_wait4_all.js"
},
"dependencies": {
"nx": "15.0.13",
"nx": "15.2.1",
"tslib": "^2.4.1"
},
"devDependencies": {
"@types/jest": "^29.2.3",
"@types/node": "^18.11.9",
"@types/node-cache": "^4.2.5",
"@typescript-eslint/eslint-plugin": "^5.43.0",
"@typescript-eslint/parser": "^5.43.0",
"@typescript-eslint/eslint-plugin": "^5.44.0",
"@typescript-eslint/parser": "^5.44.0",
"audit-ci": "^6.3.0",
"eslint": "^8.27.0",
"eslint": "^8.28.0",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-plugin-import": "latest",
"husky": "^8.0.2",
"jest": "^29.3.1",
"nodemon": "^2.0.20",
"npm-check-updates": "^16.4.1",
"npm-check-updates": "^16.4.3",
"replace": "^1.2.2",
"standard-version": "^9.5.0",
"ts-jest": "^29.0.3",
"ts-node": "^10.9.1",
"typescript": "^4.8.4",
"typescript": "^4.9.3",
"yarn-audit-fix": "^9.3.7"
},
"standard-version": {
Expand Down
4 changes: 4 additions & 0 deletions test/func/.gitignore
@@ -0,0 +1,4 @@
reports/*.html
*.log
*IGNORE*
.DS_Store
18 changes: 17 additions & 1 deletion test/func/README.md
Expand Up @@ -2,8 +2,24 @@

- Make sure you are in `test/func` directory
- Run the command `docker compose build`
- Run the command `docker compose up` (wait till all the services are up)
- Run the command `docker compose --profile debug up` (wait till all the services are up)
- Open TTK UI at [localhost:6060](http://localhost:6060) in a browser. If TTK UI does not open, give it some more time to make sure all the services are up and running.
- Go to Test Runner, Click on Collections Manager and choose `mvp-bulk.json` in `ttk-testcases` folder
- There are different test cases. If you want to run individual test case, click on Edit for that test case and click on the Send button
- If you want to run all the test cases, there is a *Run* button in Red color at the top right of the page that you can click and run all the test cases

# Steps to run end-to-end functional tests with CLI
- Make sure you are in `test/func` directory
- Run the command `docker compose build`
- Run the command `docker compose up` (wait till all the services are up)
- Wait for some time to get all the services running
- Execute the following command in a separate terminal from `test/func` folder to run the test cases using CLI
```
docker-compose -f ./ttk-tests-docker-compose.yml up
```
- You should get the html report in test/func/reports folder
- For cleanup, execute the following commands
```
docker-compose -f ./ttk-tests-docker-compose.yml down
docker compose down
```
4 changes: 2 additions & 2 deletions test/func/config/sdk-ttksim1/api-svc.env
Expand Up @@ -116,7 +116,7 @@ REJECT_TRANSFERS_ON_EXPIRED_QUOTES=false
REJECT_EXPIRED_TRANSFER_FULFILS=false

# Timeout for GET/POST/DELETE - PUT flow processing
REQUEST_PROCESSING_TIMEOUT_SECONDS=60
REQUEST_PROCESSING_TIMEOUT_SECONDS=10

# To allow transfer without a previous quote request, set this value to true.
# The incoming transfer request should consists of an ILP packet and a matching condition in this case.
Expand Down Expand Up @@ -150,4 +150,4 @@ FSPIOP_EVENT_PRODUCER_TOPIC=ttksim1-topic-sdk-outbound-domain-events

# Maximum payload limits
FSPIOP_API_SERVER_MAX_REQUEST_BYTES=209715200
BACKEND_API_SERVER_MAX_REQUEST_BYTES=209715200
BACKEND_API_SERVER_MAX_REQUEST_BYTES=209715200

0 comments on commit 973faa7

Please sign in to comment.