7 votes
Accepted

How does bitcoin functional test framework work?

The functional tests test the RPCs. The unit tests test the C++ code directly by calling the functions. The functional test frameworks uses a version of python-bitcoinrpc which can be found here. ...
  • 63.2k
6 votes
Accepted

I would like to dig into the open Taproot PR to understand it, test it and possibly even review it. Any advice or recommendations?

Previous Bitcoin Core PR review club sessions A good starting point is the various Bitcoin Core PR review club sessions that have been held thus far on specific commits of the Taproot PR. The latest ...
3 votes

Where is an example of a feature test testing bitcoin-cli?

test/functional/interface_bitcoin_cli.py is a test for bitcoin-cli itself.
  • 63.2k
3 votes
Accepted

How can I keep my disk usage under control when regularly running the Bitcoin Core functional tests?

This was answered on Twitter by various individuals. You should remove the directory /tmp/test_common_Bitcoin Core regularly. For Martin Leitner-Ankerl this was 6GB of leftover files (leftovers only ...
3 votes

Get node 1 to mine another block, send it to node 2, and check that node 2 received it

The default setup_network() implemented by the test framework connects all nodes, as explained by the comment in example_test.py's setup_network(). Since you want node 2 to be connected to nodes 1 and ...
  • 63.2k
3 votes

How do I get started debugging Bitcoin Core functional tests?

To understand the functional tests, I think it's important to start with an understanding of how bitcoind works and how the RPC interface is used. Start Bitcoin Core in a terminal window in regtest ...
  • 4,696
2 votes

How can I analyze the test coverage of the Bitcoin Core codebase?

If your intention is to contribute to Bitcoin Core, you must be able to build these reports locally. So that you can compare if your changes have been effective at increasing coverage. The general ...
  • 200
2 votes
Accepted

How can I analyze the test coverage of the Bitcoin Core codebase?

Marco Falke has a site that analyzes the current line, function and branch coverage for unit tests, functional tests and fuzz tests. Alternatively, vasild runs clang's tools and then a script to ...
2 votes
Accepted

What is Valgrind? When should I use it for debugging Bitcoin Core over using gdb, lldb, pdb etc?

If you watched Fabian's presentation (or read the transcript) you'll have seen that he said you can use Valgrind for memory leak checks and that it can be used similarly to lldb. valgrind --leak-check=...
2 votes
Accepted

What is the difference between node, peer and mininode in the functional test framework in Bitcoin Core?

When you run P2P functional tests you are spinning up regtest nodes (running simplified Python code) that connect to your full node (running the full C++ code) to test P2P functionality. As John ...
2 votes
Accepted

What is -vbparams argument and what its the difference with -testactivationheight on Bitcoin functional tests?

-testactivationheight is defined here. argsman.AddArg("-testactivationheight=name@height.", "Set the activation height of 'name' (segwit, bip34, dersig, cltv, csv). (regtest-only)",...
2 votes
Accepted

Can I speed up the running of functional tests?

The Bitcoin Core test README states: By default, up to 4 tests will be run in parallel by test_runner. To specify how many jobs to run, append --jobs=n The individual tests and the test_runner ...
2 votes
Accepted

I'm digging further into the open Taproot PR. Can you explain the bip340_test_vectors?

These bip340_test_vectors are used in two places: the unit tests (src/test/key_tests.cpp) and the functional tests (test/functional/test_framework/key.py). The Python code for testing the ...
1 vote

Error from launching single functional tests on macos

In your test/ folder, you should have a config.ini and config.ini.in file. Your config.ini should look something like: BUILDDIR=/Users/username/code/bitcoin EXEEXT= whereas according to the log ...
1 vote

"Error: no RPC connection" when trying to run Bitcoin Core functional tests

The test framework starts its own bitcoind instances, you don't need to have bitcoind separately. This error is an indication that a bitcoind is failing to start when test framework tries to start it. ...
  • 63.2k
1 vote
Accepted

Does python-bitcoinlib and the Bitcoin Core functional test framework share code? Were changes ever pushed down/upstream?

script.py of the Bitcoin Core functional test framework contains a comment that it was initially modified from python-bitcoinlib. There doesn't appear to have been any code sharing beyond that and ...
1 vote
Accepted

What backward compatibility testing is done on Bitcoin Core?

What backward compatibility testing is done to ensure the latest release passes previous releases' versions of the functional tests? There is a feature_backwards_compatibility.py functional test ...
1 vote
Accepted

What are some examples of previous first contributions improving Bitcoin Core tests?

PR #8836 was one of John Newbery's earlier contributions to Bitcoin Core. He introduced this code so that bitcoin-util-test.py would fail when the output_cmp file is empty. if not outputData: ...
1 vote

How do I get started debugging Bitcoin Core functional tests?

There are a few different resources I would point you to. For more information on functional tests in Bitcoin Core (with guidance on writing them) I would check out the functional tests README. For a ...

Only top scored, non community-wiki answers of a minimum length are eligible