Run Mojaloop
in your local machine using docker-compose without need for a Kubernetes
cluster.
- git
- docker
- docker-compose
Execute the following commands to run mojaloop in local machine
git clone https://github.com/mojaloop/ml-core-test-harness.git
cd ml-core-test-harness
docker-compose --profile all-services --profile ttk-provisioning --profile ttk-tests up
Wait for some time to get all the containers up and healthy.
You can check the status of the containers using the command docker ps
.
You should see the following output after some time. That means all your mojaloop services are up and test FSPs are onboarded successfully. Now you can run a P2P transfer.
┌───────────────────────────────────────────────────┐
│ SUMMARY │
├───────────────────┬───────────────────────────────┤
│ Total assertions │ 27 │
├───────────────────┼───────────────────────────────┤
│ Passed assertions │ 27 │
├───────────────────┼───────────────────────────────┤
│ Failed assertions │ 0 │
├───────────────────┼───────────────────────────────┤
│ Total requests │ 4 │
├───────────────────┼───────────────────────────────┤
│ Total test cases │ 1 │
├───────────────────┼───────────────────────────────┤
│ Passed percentage │ 100.00% │
├───────────────────┼───────────────────────────────┤
│ Started time │ Wed, 15 Jun 2022 17:02:28 GMT │
├───────────────────┼───────────────────────────────┤
│ Completed time │ Wed, 15 Jun 2022 17:02:30 GMT │
├───────────────────┼───────────────────────────────┤
│ Runtime duration │ 2398 ms │
└───────────────────┴───────────────────────────────┘
After all services been started, if you want to execute the P2P transfer from the command line again, use the following command in a separate terminal session.
docker-compose --project-name ttk-test-only --profile ttk-tests up --no-deps
_Note: This doesn't wait for any dependent services. You should make sure that all the services are up and healthy.
- Open the URL
http://localhost:9660
and go toTest Runner
- Goto on
Collection Manager
and click on the buttonImport Folder
- Select the folder
docker/ml-testing-toolkit/test-cases/collections/tests
and import - Select
p2p.json
and click on the masked area on the right side of the screen - Collection manager closes and click on
Run
button at the top right corner - You should see all the tests passed
- You can explore the requests and responses by clicking on
Edit
button next to the test case
You can execute a transfer using the mobile simulator page where you can see two virtual mobile applications a sender and receiver.
By making a transfer using sender mobile application, you can see all the mojaloop requests and callbacks visually by means of a live sequence diagram.
http://localhost:9660/mobilesimulator
Profile Name | Description | Dependent Profiles |
---|---|---|
all-services | All mojaloop services including TTK | - |
ttk-provisioning | For setting up mojaloop switch and onboard sample DFSPs | - |
ttk-tests | TTK tests | - |
debug | Debug utilities (kowl) | kafka |
central-ledger | Central Ledger service | kafka |
ml-api-adapter | ML API Adapter service | central-ledger |
quoting-service | Quoting service | central-ledger |
account-lookup-service | Account lookup service | central-ledger |
discovery | Services used for discovery | - |
agreement | Services used for agreement | - |
transfer | Services used for transfer | - |
docker-compose --profile all-services up
docker-compose --profile all-services --profile debug up
docker-compose --profile central-ledger up
docker-compose --profile quoting-service --profile central-ledger up
Note: We need to include central-ledger profile also here because its a dependency for quoting service
docker-compose --profile account-lookup-service --profile central-ledger up
Note: We need to include central-ledger profile also here because its a dependency for account lookup service
docker-compose --profile ml-api-adapter --profile central-ledger up
Note: We need to include central-ledger profile also here because its a dependency for ml-api-adapter
docker-compose --profile discovery up
docker-compose --profile agreement up
docker-compose --profile transfer up
TODO: Add settlement related services
TODO: Add bulk related services
You can use this repo to run functional tests inside the CICD of a core service
The following commands can be added to the CICD pipeline
git clone --depth 1 --branch v0.0.2 https://github.com/mojaloop/ml-core-test-harness.git
cd ml-core-test-harness
docker-compose --project-name ttk-func --profile all-services --profile ttk-provisioning --profile ttk-tests up -d
bash wait-for-container.sh ttk-func-ttk-tests-1
docker logs ttk-func-ttk-tests-1 > ttk-tests-console.log
docker-compose -p ttk-func down
cat ttk-tests-console.log
ls reports/ttk-func-tests-report.html reports/ttk-provisioning-report.html