Skip to content

Commit

Permalink
feat(mojaloop/#3591): add setup for e2e testing (#41)
Browse files Browse the repository at this point in the history
* chore: add setup for e2e testing

* chore: remove collection

* chore: fix timestamps
  • Loading branch information
kleyow authored Oct 27, 2023
1 parent 4c649b2 commit 60820f5
Show file tree
Hide file tree
Showing 9 changed files with 439 additions and 1 deletion.
26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,23 @@ docker compose --project-name ml-core -f docker-compose-perf.yml --profile quote

> NOTE: `-v` argument is optional, and it will delete any volume data created by the monitoring docker compose
### Running Services for Full E2E (Discovery+Agreement+Transfers) characterization

- Set `ALS_SWITCH_ENDPOINT` to "http://central-ledger:3001" in perf.env
- Set `QS_SWITCH_ENDPOINT` to "http://central-ledger:3001" in perf.env

```bash
docker compose --project-name ml-core -f docker-compose-perf.yml --profile all-services --profile 8dfsp --profile ttk-provisioning-e2e up -d
```

Stop Services

```bash
docker compose --project-name ml-core -f docker-compose-perf.yml --profile all-services --profile 8dfsp down -v
```

> NOTE: `-v` argument is optional, and it will delete any volume data created by the monitoring docker compose
### Configuration for Transfers with batch support
- Set CENTRAL_LEDGER_POSITION_BATCH_REPLICAS to desired count in `.env` file
- Enable line `CLEDG_KAFKA__EVENT_TYPE_ACTION_TOPIC_MAP__POSITION__PREPARE=topic-transfer-position-batch` in `perf.env` file
Expand Down Expand Up @@ -270,6 +287,13 @@ docker compose --project-name monitoring --profile quotes-test -f docker-compose

since the quoting service uses the central ledger database.

Start monitoring with all exporters

```bash
docker compose --project-name monitoring --profile als-test --profile quotes-test --profile transfers-test -f docker-compose-monitoring.yml up -d
```


> NOTE: `-v` argument is optional, and it will delete any volume data created by the monitoring docker compose
TODO:
Expand Down Expand Up @@ -313,6 +337,8 @@ env K6_SCRIPT_CONFIG_FILE_NAME=fspiopTransfersUnidirectional.json docker compose
env K6_SCRIPT_CONFIG_FILE_NAME=fspiopDiscovery.json docker compose --project-name load -f docker-compose-load.yml up
( or )
env K6_SCRIPT_CONFIG_FILE_NAME=fspiopQuotes.json docker compose --project-name load -f docker-compose-load.yml up
( or )
env K6_SCRIPT_CONFIG_FILE_NAME=fspiopE2E.json docker compose --project-name load -f docker-compose-load.yml up
```

Cleanup tests
Expand Down
25 changes: 25 additions & 0 deletions docker-compose-perf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,7 @@ services:
interval: 15s
user: root
profiles:
- all-services
- quotes-test

# objstore:
Expand Down Expand Up @@ -846,6 +847,30 @@ services:
profiles:
- ttk-provisioning-quotes

ttk-provisioning-e2e:
image: mojaloop/ml-testing-toolkit-client-lib:${TEST_TTK_CLI_VERSION}
env_file:
- .env
- perf.env
volumes:
- "./docker/ml-testing-toolkit/test-cases/collections:/opt/app/collections"
- "./docker/ml-testing-toolkit/test-cases/environments:/opt/app/environments"
- "./reports:/opt/app/reports"
depends_on:
mojaloop-testing-toolkit:
condition: service_healthy
central-ledger:
condition: service_healthy
networks:
- mojaloop-net
command:
- sh
- -c
- "npm run cli -- -u http://mojaloop-testing-toolkit:5050 -l 2 -i collections/provisioning -e environments/perf-e2e-env.json --save-report --report-format html --report-target file://reports/ttk-provisioning-report.html"
user: root
profiles:
- ttk-provisioning-e2e

callback-handler-svc-oracle-sim:
image: mojaloop/callback-handler-svc:${TEST_CALLBACK_HAND_SVC_VERSION}
deploy:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -699,4 +699,4 @@
]
}
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
{
"inputValues": {
"CALLBACK_ENDPOINT_BASE_URL": "http://mojaloop-testing-toolkit:4040",
"HOST_ACCOUNT_LOOKUP_ADMIN": "http://account-lookup-service:4001",
"HOST_ACCOUNT_LOOKUP_SERVICE": "http://account-lookup-service:4002",
"HOST_CENTRAL_LEDGER": "http://central-ledger:3001",
"HOST_ML_API_ADAPTER": "http://ml-api-adapter:3000",
"HOST_QUOTING_SERVICE": "http://quoting-service:3002",
"HOST_SIMULATOR": "http://callback-handler-svc-oracle-sim:3001",
"ENABLE_WS_ASSERTIONS": true,
"WS_ASSERTION_TIMEOUT": 5000,
"accept": "application/vnd.interoperability.parties+json;version=1.0",
"acceptParticipants": "application/vnd.interoperability.participants+json;version=1.0",
"acceptQuotes": "application/vnd.interoperability.quotes+json;version=1.0",
"acceptTransfers": "application/vnd.interoperability.transfers+json;version=1.0",
"amount": "100",
"condition": "n2cwS3w4ekGlvNYoXg2uBAqssu3FCoXjADE2mziU5jU",
"contentType": "application/vnd.interoperability.parties+json;version=1.0",
"contentTypeParticipants": "application/vnd.interoperability.participants+json;version=1.0",
"contentTypeQuotes": "application/vnd.interoperability.quotes+json;version=1.0",
"currency": "USD",
"currency2": "BGN",
"cgscurrency": "INR",
"fromDOB": "1984-01-01",
"fromFirstName": "Firstname-Test",
"fromFspId": "pinkbankfsp",
"fromIdType": "MSISDN",
"fromIdValue": "44123456789",
"fromLastName": "Lastname-Test",
"hubEmail": "[email protected]",
"hub_operator": "NOT_APPLICABLE",
"ilpPacket": "AYIDBQAAAAAAACcQJGcucGF5ZWVmc3AubXNpc2RuLnt7cmVjZWl2ZXJtc2lzZG59fYIC1GV5SjBjbUZ1YzJGamRHbHZia2xrSWpvaVptVXhNREU0Wm1NdE1EaGxZeTAwWWpJM0xUbGpZalF0TnpjMk9URTFNR00zT1dKaklpd2ljWFZ2ZEdWSlpDSTZJbVpsTVRBeE9HWmpMVEE0WldNdE5HSXlOeTA1WTJJMExUYzNOamt4TlRCak56bGlZeUlzSW5CaGVXVmxJanA3SW5CaGNuUjVTV1JKYm1adklqcDdJbkJoY25SNVNXUlVlWEJsSWpvaVRWTkpVMFJPSWl3aWNHRnlkSGxKWkdWdWRHbG1hV1Z5SWpvaWUzdHlaV05sYVhabGNrMVRTVk5FVG4xOUlpd2labk53U1dRaU9pSndZWGxsWldaemNDSjlmU3dpY0dGNVpYSWlPbnNpY0dGeWRIbEpaRWx1Wm04aU9uc2ljR0Z5ZEhsSlpGUjVjR1VpT2lKTlUwbFRSRTRpTENKd1lYSjBlVWxrWlc1MGFXWnBaWElpT2lJeU56Y3hNemd3TXprd05TSXNJbVp6Y0Vsa0lqb2ljR0Y1WlhKbWMzQWlmU3dpY0dWeWMyOXVZV3hKYm1adklqcDdJbU52YlhCc1pYaE9ZVzFsSWpwN0ltWnBjbk4wVG1GdFpTSTZJazFoZEhNaUxDSnNZWE4wVG1GdFpTSTZJa2hoWjIxaGJpSjlMQ0prWVhSbFQyWkNhWEowYUNJNklqRTVPRE10TVRBdE1qVWlmWDBzSW1GdGIzVnVkQ0k2ZXlKaGJXOTFiblFpT2lJeE1EQWlMQ0pqZFhKeVpXNWplU0k2SWxWVFJDSjlMQ0owY21GdWMyRmpkR2x2YmxSNWNHVWlPbnNpYzJObGJtRnlhVzhpT2lKVVVrRk9VMFpGVWlJc0ltbHVhWFJwWVhSdmNpSTZJbEJCV1VWU0lpd2lhVzVwZEdsaGRHOXlWSGx3WlNJNklrTlBUbE5WVFVWU0luMTkA",
"note": "test",
"payeefsp": "greenbankfsp",
"payerfsp": "pinkbankfsp",
"toFspId": "greenbankfsp",
"toIdType": "MSISDN",
"toIdValue": "27713803912",
"mobileSimPayerFsp": "pinkbankfsp",
"mobileSimPayeeFsp": "greenbankfsp",
"expectedPartiesVersion": "1.0",
"expectedParticipantsVersion": "1.0",
"expectedQuotesVersion": "1.0",
"expectedTransfersVersion": "1.0",
"acceptParties": "application/vnd.interoperability.parties+json;version=1.1",
"contentTypeTransfers": "application/vnd.interoperability.transfers+json;version=1.1",
"contentTypeParties": "application/vnd.interoperability.parties+json;version=1.1",
"NET_DEBIT_CAP": "50000000",
"PERF_FSP1_ID": "perffsp1",
"PERF_FSP2_ID": "perffsp2",
"PERF_FSP3_ID": "perffsp3",
"PERF_FSP4_ID": "perffsp4",
"PERF_FSP5_ID": "perffsp5",
"PERF_FSP6_ID": "perffsp6",
"PERF_FSP7_ID": "perffsp7",
"PERF_FSP8_ID": "perffsp8",
"PERF_FSP1_MSISDN": "19012345001",
"PERF_FSP2_MSISDN": "19012345002",
"PERF_FSP3_MSISDN": "19012345003",
"PERF_FSP4_MSISDN": "19012345004",
"PERF_FSP5_MSISDN": "19012345005",
"PERF_FSP6_MSISDN": "19012345006",
"PERF_FSP7_MSISDN": "19012345007",
"PERF_FSP8_MSISDN": "19012345008",
"PERF_FSP1_CALLBACK_ENDPOINT_BASE_URL": "http://sim-perffsp1:3001/fspiop",
"PERF_FSP2_CALLBACK_ENDPOINT_BASE_URL": "http://sim-perffsp2:3001/fspiop",
"PERF_FSP3_CALLBACK_ENDPOINT_BASE_URL": "http://sim-perffsp3:3001/fspiop",
"PERF_FSP4_CALLBACK_ENDPOINT_BASE_URL": "http://sim-perffsp4:3001/fspiop",
"PERF_FSP5_CALLBACK_ENDPOINT_BASE_URL": "http://sim-perffsp5:3001/fspiop",
"PERF_FSP6_CALLBACK_ENDPOINT_BASE_URL": "http://sim-perffsp6:3001/fspiop",
"PERF_FSP7_CALLBACK_ENDPOINT_BASE_URL": "http://sim-perffsp7:3001/fspiop",
"PERF_FSP8_CALLBACK_ENDPOINT_BASE_URL": "http://sim-perffsp8:3001/fspiop",
"PERF_ORACLE_ENDPOINT_BASE_URL": "http://callback-handler-svc-oracle-sim:3001/oracle"
}
}
21 changes: 21 additions & 0 deletions packages/k6-tests/config/fspiopE2E.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"scenarios": {
"fspiopE2E": {
"executor": "ramping-vus",
"exec": "fspiopE2EScenarios",
"env": {
"UNIDIRECTIONAL": "false"
},
"startVUs": 1,
"stages": [
{ "duration": "30s", "target": 30 },
{ "duration": "5m", "target": 30 }
]
}
},
"thresholds": {
"iteration_duration": [ "p(95)<1000" ],
"http_req_failed": [ "rate<0.01" ],
"http_req_duration": [ "p(95)<1000" ]
}
}
1 change: 1 addition & 0 deletions packages/k6-tests/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ export { fspiopTransfersScenarios } from './scenarios/fspiopTransfers.js';
export { fspiopTransfersNoCallbackScenarios } from './scenarios/fspiopTransfersNoCallback.js';
export { fspiopQuotesScenarios } from './scenarios/fspiopQuotes.js';
export { fspiopQuotesPersonalInfoExtensionsScenarios } from './scenarios/fspiopQuotesPersonalInfoExtensions.js';
export { fspiopE2EScenarios } from './scenarios/fspiopE2E.js';

const configFile = __ENV.K6_SCRIPT_CONFIG_FILE_NAME ? './config/' + __ENV.K6_SCRIPT_CONFIG_FILE_NAME : './config/test.json';
const testConfig = JSON.parse(open(configFile));
Expand Down
6 changes: 6 additions & 0 deletions packages/k6-tests/scenarios/fspiopE2E.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { E2E } from "../scripts/E2E.js";


export function fspiopE2EScenarios() {
E2E();
}
Loading

0 comments on commit 60820f5

Please sign in to comment.