Commit 808898f
committed
Merge bitcoin/bitcoin#30291: test: write functional test results to csv
ad06e68 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 ad06e68
kevkevinpal:
tACK [ad06e68](bitcoin/bitcoin@ad06e68)
achow101:
ACK ad06e68
rkrux:
tACK [ad06e68](bitcoin/bitcoin@ad06e68)
brunoerg:
ACK ad06e68
marcofleon:
Good idea, tested ACK ad06e68
Tree-SHA512: 561194406cc744905518aa5ac6850c07c4aaecdaf5d4d8b250671b6e90093d4fc458f050e8a85374e66359cc0e0eaceba5eb24092c55f0d8f349d744a32ef76c1 file changed
+28
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
| 21 | + | |
20 | 22 | | |
21 | 23 | | |
22 | 24 | | |
| |||
439 | 441 | | |
440 | 442 | | |
441 | 443 | | |
| 444 | + | |
442 | 445 | | |
443 | 446 | | |
444 | 447 | | |
| |||
471 | 474 | | |
472 | 475 | | |
473 | 476 | | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
474 | 484 | | |
475 | 485 | | |
476 | 486 | | |
| |||
557 | 567 | | |
558 | 568 | | |
559 | 569 | | |
| 570 | + | |
560 | 571 | | |
561 | 572 | | |
562 | | - | |
| 573 | + | |
563 | 574 | | |
564 | 575 | | |
565 | 576 | | |
| |||
651 | 662 | | |
652 | 663 | | |
653 | 664 | | |
654 | | - | |
| 665 | + | |
655 | 666 | | |
656 | 667 | | |
657 | 668 | | |
658 | | - | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
659 | 673 | | |
660 | 674 | | |
661 | 675 | | |
| |||
702 | 716 | | |
703 | 717 | | |
704 | 718 | | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
705 | 730 | | |
706 | 731 | | |
707 | 732 | | |
| |||
0 commit comments