0g-storage-node/tests
Chenxing Li 16dfc56437
Test mining with the simple market (#31)
* Test mining with the simple market

* Support reward donation
2024-03-19 14:09:17 +08:00
..
config fix: contract, tests, clippy (#11) 2024-01-26 16:13:18 +08:00
test_framework Test mining with the simple market (#31) 2024-03-19 14:09:17 +08:00
utility Test mining with the simple market (#31) 2024-03-19 14:09:17 +08:00
cache_test.py feat: write cached segments to storage on log synced (#7) 2024-01-23 18:47:14 +08:00
ccov.sh Initial commit 2024-01-04 18:05:32 +08:00
cli_submission_test.py Fix python test (#8) 2024-01-24 20:42:25 +08:00
crash_test.py Fix python test (#8) 2024-01-24 20:42:25 +08:00
dep_pip3.sh Initial commit 2024-01-04 18:05:32 +08:00
example_test.py Initial commit 2024-01-04 18:05:32 +08:00
fuzz_test.py Initial commit 2024-01-04 18:05:32 +08:00
mine_test.py Initial commit 2024-01-04 18:05:32 +08:00
mine_with_market_test.py Test mining with the simple market (#31) 2024-03-19 14:09:17 +08:00
parallel_submission_test.py Initial commit 2024-01-04 18:05:32 +08:00
partial_submission_test.py Initial commit 2024-01-04 18:05:32 +08:00
random_test.py feat: write cached segments to storage on log synced (#7) 2024-01-23 18:47:14 +08:00
readme.md add readme for python tests (#5) 2024-01-19 21:26:33 +08:00
recovery_test.py Initial commit 2024-01-04 18:05:32 +08:00
revert_test.py Initial commit 2024-01-04 18:05:32 +08:00
rpc_test.py Fix python test (#8) 2024-01-24 20:42:25 +08:00
same_root_test.py Initial commit 2024-01-04 18:05:32 +08:00
submission_test.py Fix python test (#8) 2024-01-24 20:42:25 +08:00
sync_test.py Save updated mpt nodes from proof to DB. (#20) 2024-02-06 18:46:35 +08:00
test_all.py refactor python run all (#18) 2024-02-01 15:54:31 +08:00

Python Tests for Storage node

Prerequisites

  1. Required python version: 3.8, 3.9, 3.10, higher version is not guaranteed (e.g. failed to install pysha3).

  2. Install dependencies under root folder:

pip3 install -r requirements.txt

Dependent Binaries

Python test framework will launch blockchain fullnodes at local for storage node to interact with. There are 2 kinds of fullnodes supported:

  • Conflux eSpace node (by default).
  • BSC node (geth).

For Conflux eSpace node, the test framework will automatically compile the binary at runtime, and copy the binary to tests/tmp folder. For BSC node, the test framework will automatically download the latest version binary from github to tests/tmp folder.

Alternatively, you could also manually copy specific versoin binaries (conflux or geth) to the tests/tmp folder. Note, do NOT copy released conflux binary on github, since block height of some CIPs are hardcoded.

Run Tests

Go to the tests folder and run following command to run all tests:

python test_all.py

or, run any single test, e.g.

python sync_test.py

Troubleshootings

  1. Test failed due to blockchain fullnode rpc inaccessible.
  • Traceback: node.wait_for_rpc_connection()
  • Solution: unset the http_proxy and https_proxy environment variables if configured.