Skip to content

Commit 88eff96

Browse files
author
MarcoFalke
committed
Merge #17177: doc: Describe log files + consistent paths in test READMEs
9576614 doc: Describe log files + consistent paths in test READMEs (Martin Erlandsson) Pull request description: picks up #15830 I saw this was almost ready to merge but the test logging part was not 100% correct. I reworked that part, the rest is the same. ACKs for top commit: GChuf: ACK 9576614 Tree-SHA512: 3de7f1b0a1b0419df6e7b55964d00e715b6cb7874b1849ad6f120597610d7df4182c4b61b9c9691ce04f4e392ed3caead4c623374be2066ac31319e702d45d09
2 parents ec3ed5a + 9576614 commit 88eff96

File tree

2 files changed

+31
-19
lines changed

2 files changed

+31
-19
lines changed

test/README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ By default, up to 4 tests will be run in parallel by test_runner. To specify
8888
how many jobs to run, append `--jobs=n`
8989

9090
The individual tests and the test_runner harness have many command-line
91-
options. Run `test_runner.py -h` to see them all.
91+
options. Run `test/functional/test_runner.py -h` to see them all.
9292

9393
#### Troubleshooting and debugging test failures
9494

@@ -101,7 +101,7 @@ killed all its bitcoind nodes), then there may be a port conflict which will
101101
cause the test to fail. It is recommended that you run the tests on a system
102102
where no other bitcoind processes are running.
103103

104-
On linux, the test_framework will warn if there is another
104+
On linux, the test framework will warn if there is another
105105
bitcoind process running when the tests are started.
106106

107107
If there are zombie bitcoind processes after test failure, you can kill them
@@ -130,7 +130,7 @@ tests will fail. If this happens, remove the cache directory (and make
130130
sure bitcoind processes are stopped as above):
131131

132132
```bash
133-
rm -rf cache
133+
rm -rf test/cache
134134
killall bitcoind
135135
```
136136

@@ -149,6 +149,15 @@ levels using the logger included in the test_framework, e.g.
149149
fails, the `test_framework.log` and bitcoind `debug.log`s will all be dumped
150150
to the console to help troubleshooting.
151151

152+
These log files can be located under the test data directory (which is always
153+
printed in the first line of test output):
154+
- `<test data directory>/test_framework.log`
155+
- `<test data directory>/node<node number>/regtest/debug.log`.
156+
157+
The node number identifies the relevant test node, starting from `node0`, which
158+
corresponds to its position in the nodes list of the specific test,
159+
e.g. `self.nodes[0]`.
160+
152161
To change the level of logs output to the console, use the `-l` command line
153162
argument.
154163

@@ -157,7 +166,7 @@ aggregate log by running the `combine_logs.py` script. The output can be plain
157166
text, colorized text or html. For example:
158167

159168
```
160-
combine_logs.py -c <test data directory> | less -r
169+
test/functional/combine_logs.py -c <test data directory> | less -r
161170
```
162171

163172
will pipe the colorized logs from the test into less.

test/functional/README.md

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
#### Example test
66

7-
The [example_test.py](example_test.py) is a heavily commented example of a test case that uses both
8-
the RPC and P2P interfaces. If you are writing your first test, copy that file
9-
and modify to fit your needs.
7+
The file [test/functional/example_test.py](example_test.py) is a heavily commented example
8+
of a test case that uses both the RPC and P2P interfaces. If you are writing your first test, copy
9+
that file and modify to fit your needs.
1010

1111
#### Coverage
1212

13-
Running `test_runner.py` with the `--coverage` argument tracks which RPCs are
13+
Running `test/functional/test_runner.py` with the `--coverage` argument tracks which RPCs are
1414
called by the tests and prints a report of uncovered RPCs in the summary. This
1515
can be used (along with the `--extended` argument) to find out which RPCs we
1616
don't have test cases for.
@@ -82,7 +82,7 @@ P2P messages. These can be found in the following source files:
8282

8383
#### Using the P2P interface
8484

85-
- `messages.py` contains all the definitions for objects that pass
85+
- [messages.py](test_framework/messages.py) contains all the definitions for objects that pass
8686
over the network (`CBlock`, `CTransaction`, etc, along with the network-level
8787
wrappers for them, `msg_block`, `msg_tx`, etc).
8888

@@ -96,32 +96,35 @@ the Bitcoin Core node application logic. For custom behaviour, subclass the
9696
P2PInterface object and override the callback methods.
9797

9898
- Can be used to write tests where specific P2P protocol behavior is tested.
99-
Examples tests are `p2p_unrequested_blocks.py`, `p2p_compactblocks.py`.
99+
Examples tests are [p2p_unrequested_blocks.py](p2p_unrequested_blocks.py),
100+
[p2p_compactblocks.py](p2p_compactblocks.py).
100101

101-
### test-framework modules
102+
### Test framework modules
103+
The following are useful modules for test developers. They are located in
104+
[test/functional/test_framework/](test_framework).
102105

103-
#### [test_framework/authproxy.py](test_framework/authproxy.py)
106+
#### [authproxy.py](test_framework/authproxy.py)
104107
Taken from the [python-bitcoinrpc repository](https://github.com/jgarzik/python-bitcoinrpc).
105108

106-
#### [test_framework/test_framework.py](test_framework/test_framework.py)
109+
#### [test_framework.py](test_framework/test_framework.py)
107110
Base class for functional tests.
108111

109-
#### [test_framework/util.py](test_framework/util.py)
112+
#### [util.py](test_framework/util.py)
110113
Generally useful functions.
111114

112-
#### [test_framework/mininode.py](test_framework/mininode.py)
115+
#### [mininode.py](test_framework/mininode.py)
113116
Basic code to support P2P connectivity to a bitcoind.
114117

115-
#### [test_framework/script.py](test_framework/script.py)
118+
#### [script.py](test_framework/script.py)
116119
Utilities for manipulating transaction scripts (originally from python-bitcoinlib)
117120

118-
#### [test_framework/key.py](test_framework/key.py)
121+
#### [key.py](test_framework/key.py)
119122
Test-only secp256k1 elliptic curve implementation
120123

121-
#### [test_framework/bignum.py](test_framework/bignum.py)
124+
#### [bignum.py](test_framework/bignum.py)
122125
Helpers for script.py
123126

124-
#### [test_framework/blocktools.py](test_framework/blocktools.py)
127+
#### [blocktools.py](test_framework/blocktools.py)
125128
Helper functions for creating blocks and transactions.
126129

127130
### Benchmarking with perf

0 commit comments

Comments
 (0)