Skip to Content
DevelopersFunctional Tests

Functional Tests

Functional tests live in test/functional/. They start local regtest nodes and exercise node behavior through RPC and P2P interfaces.

This page is for contributors writing or running functional tests. It is not the general testing overview; see Testing.

Running Tests

From the Tidecoin Core repository after building:

build/test/functional/test_runner.py

Run a single test:

build/test/functional/test_runner.py wallet_pqhd_policy.py

Run several tests:

build/test/functional/test_runner.py wallet_pqhd_policy.py auxpow_mining.py

Control parallelism:

build/test/functional/test_runner.py --jobs=1

Tidecoin-Specific Tests

AreaTests
PQHD wallet policywallet_pqhd_policy.py, wallet_pqhd_seed_lifecycle.py
PQ script assetsfeature_pq_script_assets.py
AuxPoWauxpow_mining.py, auxpow_invalidpow.py, auxpow_zerohash.py
P2P v2 transportp2p_v2_transport.py, p2p_v2_encrypted.py

Writing a Test

  1. Start from test/functional/example_test.py or a nearby test.
  2. Name the file by area, such as wallet_..., rpc_..., p2p_..., or feature_....
  3. Use a module docstring that explains what the test covers.
  4. Keep self.num_nodes as small as possible.
  5. Prefer named RPC arguments when a call has many parameters.
  6. Use self.log.info(...) to explain test phases in the log.
  7. Add the test to the runner metadata when required by the framework.

Regtest Activation Notes

Tidecoin regtest activates AuxPoW-related rules from genesis. Tests can still create non-AuxPoW blocks where the helper supports it, but test authors should be explicit about whether they are testing pre-AuxPoW or post-AuxPoW behavior.

Do not assume Bitcoin subsidy values, ECDSA key behavior, or Bitcoin descriptor semantics in Tidecoin tests.

Debugging

NeedTool
Keep datadirs--nocleanup
Reduce noise--jobs=1
Inspect RPC coverage--coverage
See all optionsbuild/test/functional/test_runner.py -h
Profile on Linuxfunctional test --perf support

See also: Testing, Fuzzing, PQ Test Vectors.

Last updated on