Run this line locally from rchain project root before you do a PR. If there is a FAIL not all PASS at the end fix your code or fix the issue with the integrations test script. Jeremy Busk will be glad to help.
sudo sbt -Dsbt.log.noformat=true clean rholang/bnfc:generate casper/test:compile node/docker:publishLocal && sudo ./scripts/p2p-test-tool.py -b -t |
The docker images stay up so you can login and run commands unless they fail via docker exec -it peer0.rchain.coop /bin/bash
You can always do docker logs bootstrap.rchain.coop, docker logs peer0.rchain.coop or docker logs peer1.rchain.coop to get logs after container failure and shutdown.
Getting Started with RChain P2P Networked Nodes Testing Tool
Note: This is first release and will be getting updates soon. We'll be adding Python unittest library and refactoring for optimization and easier adding of tests.
The p2p-test-tool.py has been created in order to make testing RChain node(rnode) error free functionality easier.
By default this creates a standalone server to act as bootstrap server called bootstrap.rchain.coop and and two "peer nodes for testing.
bootstrap.rchain.coop
peer0.rchain.coop
peer1.rchain.coop
Get going with the script with some simple steps.
You should look for FAIL in summary results. If so you will need to find out why.
You can search for issues through docker log files that are dumped at the end of every run before summary results.
If on local machine you can run ./scripts/p2p-test-tool.py -l and all logs will be printed out for all peer nodes. You can grep to look for issues.
A successful run will complete with all passes like below.
===========================================================
=================TEST SUMMARY RESULTS======================
PASS: peer1.rchain.coop: Metrics API http/tcp/9095 is available.
PASS: peer0.rchain.coop: Metrics API http/tcp/9095 is available.
PASS: peer1.rchain.coop: Peers count correct in node logs.
PASS: peer0.rchain.coop: Peers count correct in node logs.
PASS: peer1.rchain.coop: Rholang evaluation of files performed correctly.
PASS: peer0.rchain.coop: Rholang evaluation of files performed correctly.
PASS: peer0.rchain.coop: REPL loader success!
PASS: peer1.rchain.coop: No errors defined by "ERROR" in logs.
PASS: peer0.rchain.coop: No errors defined by "ERROR" in logs.
PASS: peer1.rchain.coop: No text of "RuntimeException" in logs.
PASS: peer0.rchain.coop: No text of "RuntimeException" in logs.
PASS ALL: All tests successfully passed
===========================================================
===========================================================
Other common examples:
You're a pro now. Play around with things. It's docker!
Please add more as needed.
More to come!.