Ava Chow 808898fddf
Merge bitcoin/bitcoin#30291: test: write functional test results to csv
ad06e68399da71c615db0dbf5304d0cd46bc1f40 test: write functional test results to csv (tdb3)

Pull request description:

  Adds argument `--resultsfile` to test_runner.py.
  Enables functional test results to be written to a (csv) file for processing by other applications (or for historical archiving).
  Test name, status, and duration are written to the file provided with the argument.

  Since `test_runner.py` is being touched, also fixes a misspelling (linter warning).   Can split into its own commit if desired.

  #### Notes
   - Total runtime of functional tests has seemed to have increased on my development machines over the past few months (more tests added, individual test runtime increase, etc.).  Was interested in recording test runtime data over time to detect trends.  Initially searched `doc/benchmarking.md`, existing PRs, and Issues, but didn't immediately see this type of capability or alternate solutions (please chime in if you know of one!).  Thought it would be beneficial to add this capability to `test_runner` to facilitate this type of data analysis (and potentially other use cases)
   - Saw https://github.com/bitcoin/bitcoin/blob/master/test/functional/README.md#benchmarking-with-perf, and this PR's higher level data seems complimentary.
   - Was on the fence as to whether to expand `print_results()` (i.e. take advantage of the same loop over `test_results`) or implement in a separate `write_results()` function.  Decided on the latter for now, but interested in reviewers' thoughts.

  #### Example 1: all tests pass
  ```
  $ test/functional/test_runner.py --resultsfile functional_test_results.csv --cachedir=/mnt/tmp/cache --tmpdir=/mnt/tmp feature_blocksdir wallet_startup feature_config_args mempool_accept
  Temporary test directory at /mnt/tmp/test_runner_₿_🏃_20240614_201625
  Test results will be written to functional_test_results.csv
  ...

  $ cat functional_test_results.csv
  test,status,duration(seconds)
  feature_blocksdir.py,Passed,1
  feature_config_args.py,Passed,29
  mempool_accept.py,Passed,9
  wallet_startup.py,Passed,2
  ALL,Passed,29
  ```

  #### Example 2: one test failure
  ```
  $ cat functional_test_results.csv
  test,status,duration(seconds)
  feature_blocksdir.py,Passed,1
  feature_config_args.py,Passed,28
  wallet_startup.py,Passed,2
  mempool_accept.py,Failed,1
  ALL,Failed,28
  ```

ACKs for top commit:
  maflcko:
    re-ACK ad06e68399da71c615db0dbf5304d0cd46bc1f40
  kevkevinpal:
    tACK [ad06e68](ad06e68399)
  achow101:
    ACK ad06e68399da71c615db0dbf5304d0cd46bc1f40
  rkrux:
    tACK [ad06e68](ad06e68399)
  brunoerg:
    ACK ad06e68399da71c615db0dbf5304d0cd46bc1f40
  marcofleon:
    Good idea, tested ACK ad06e68399da71c615db0dbf5304d0cd46bc1f40

Tree-SHA512: 561194406cc744905518aa5ac6850c07c4aaecdaf5d4d8b250671b6e90093d4fc458f050e8a85374e66359cc0e0eaceba5eb24092c55f0d8f349d744a32ef76c
2024-06-17 14:54:08 -04:00
2024-02-07 09:24:32 +00:00
2024-06-10 13:15:23 +01:00
2023-06-01 23:35:10 +05:30
2021-09-09 19:53:12 +05:30

Bitcoin Core integration/staging tree

https://bitcoincore.org

For an immediately usable, binary version of the Bitcoin Core software, see https://bitcoincore.org/en/download/.

What is Bitcoin Core?

Bitcoin Core connects to the Bitcoin peer-to-peer network to download and fully validate blocks and transactions. It also includes a wallet and graphical user interface, which can be optionally built.

Further information about Bitcoin Core is available in the doc folder.

License

Bitcoin Core is released under the terms of the MIT license. See COPYING for more information or see https://opensource.org/licenses/MIT.

Development Process

The master branch is regularly built (see doc/build-*.md for instructions) and tested, but it is not guaranteed to be completely stable. Tags are created regularly from release branches to indicate new official, stable release versions of Bitcoin Core.

The https://github.com/bitcoin-core/gui repository is used exclusively for the development of the GUI. Its master branch is identical in all monotree repositories. Release branches and tags do not exist, so please do not fork that repository unless it is for development reasons.

The contribution workflow is described in CONTRIBUTING.md and useful hints for developers can be found in doc/developer-notes.md.

Testing

Testing and code review is the bottleneck for development; we get more pull requests than we can review and test on short notice. Please be patient and help out by testing other people's pull requests, and remember this is a security-critical project where any mistake might cost people lots of money.

Automated Testing

Developers are strongly encouraged to write unit tests for new code, and to submit new unit tests for old code. Unit tests can be compiled and run (assuming they weren't disabled in configure) with: make check. Further details on running and extending unit tests can be found in /src/test/README.md.

There are also regression and integration tests, written in Python. These tests can be run (if the test dependencies are installed) with: test/functional/test_runner.py

The CI (Continuous Integration) systems make sure that every pull request is built for Windows, Linux, and macOS, and that unit/sanity tests are run automatically.

Manual Quality Assurance (QA) Testing

Changes should be tested by somebody other than the developer who wrote the code. This is especially important for large or high-risk changes. It is useful to add a test plan to the pull request description if testing the changes is not straightforward.

Translations

Changes to translations as well as new translations can be submitted to Bitcoin Core's Transifex page.

Translations are periodically pulled from Transifex and merged into the git repository. See the translation process for details on how this works.

Important: We do not accept translation changes as GitHub pull requests because the next pull from Transifex would automatically overwrite them again.

Description
Bitcoin Core integration/staging tree
Readme 2.4 GiB
Languages
C++ 64.4%
Python 19.7%
C 12.1%
CMake 1.2%
Shell 0.9%
Other 1.6%