Background is that some tests don't have any self.log call at all. Thus there are no "anchor points" and those tests are hard to debug because the logs can't easily be parsed by a human.
test: Explain why test logging should be used #18305
pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:2003-docWhyTestLog changing 2 files +5 −2-
MarcoFalke commented at 6:36 PM on March 9, 2020: member
-
jonatack commented at 7:08 PM on March 9, 2020: member
Yes, I have a list of tests I wanted to add logging to, but I was not sure that kind of change was desired. I ended up closing my last PR like that (#17535) due to lack of interest. Maybe one PR that adds all the missing logging would be helpful.
- DrahtBot added the label Docs on Mar 9, 2020
- DrahtBot added the label Tests on Mar 9, 2020
-
MarcoFalke commented at 7:12 PM on March 9, 2020: member
Looks like #17535 changed the release notes, refactored the test, and added logging. It seems a bit too much for one pull.
-
in test/README.md:148 in fa47bf195f outdated
144 | @@ -145,7 +145,7 @@ levels using the logger included in the test_framework, e.g. 145 | `test_framework.log` and no logs are output to the console. 146 | - when run directly, *all* logs are written to `test_framework.log` and INFO 147 | level and above are output to the console. 148 | -- when run on Travis, no logs are output to the console. However, if a test 149 | +- when run [on ci](/ci/README.md), no logs are output to the console. However, if a test
MarcoFalke commented at 8:25 PM on March 9, 2020:Adjusted to "our CI"
in test/functional/README.md:54 in fa47bf195f outdated
50 | @@ -51,10 +51,13 @@ don't have test cases for. 51 | 52 | #### General test-writing advice 53 | 54 | +- Instead of inline comments or no test documentation at all, prefer to log the comments to the test log. E.g.
jonatack commented at 8:02 PM on March 9, 2020:maybe omit "prefer to"
s/. E.g./, e.g./
MarcoFalke commented at 8:25 PM on March 9, 2020:Done both
in test/functional/README.md:55 in fa47bf195f outdated
50 | @@ -51,10 +51,13 @@ don't have test cases for. 51 | 52 | #### General test-writing advice 53 | 54 | +- Instead of inline comments or no test documentation at all, prefer to log the comments to the test log. E.g. 55 | + `self.log.info('Creating enough transactions to fill a block'`. Logs make the test code easier to read and the test
jonatack commented at 8:04 PM on March 9, 2020:According to review feedback, it may be better (and shorter) to use the indicative, e.g. "Create..." rather than "Creating..."
jonatack commented at 8:16 PM on March 9, 2020:(That comment proposes some good guidelines for your consideration:)
- "test x" rather than "testing x"
- logs can replace docstrings/comment blocks
- no need for trailing '...' ellipses
MarcoFalke commented at 8:25 PM on March 9, 2020:Thanks, made shorter
jonatack commented at 8:07 PM on March 9, 2020: memberACK modulo comments
MarcoFalke force-pushed on Mar 9, 2020MarcoFalke commented at 8:26 PM on March 9, 2020: memberAdressed @jonatack feedback
jonatack commented at 8:41 PM on March 9, 2020: memberACK. Looked at the changes on the PR branch. Good additions and :+1: to no longer refer to travis.
in test/functional/README.md:55 in eeeedcb77c outdated
50 | @@ -51,10 +51,13 @@ don't have test cases for. 51 | 52 | #### General test-writing advice 53 | 54 | +- Instead of inline comments or no test documentation at all, log the comments to the test log, e.g. 55 | + `self.log.info('Create enough transactions to fill a block'`. Logs make the test code easier to read and the test
fanquake commented at 11:54 AM on March 10, 2020:nit: does this need a closing
)
jonatack commented at 12:20 PM on March 10, 2020:good eye
MarcoFalke commented at 12:25 PM on March 10, 2020:Added
), and changed commit hash from eeee... to ffff...fanquake approvedfanquake commented at 11:54 AM on March 10, 2020: memberACK eeeedcb77c89c2be4545670bc9f47b86c3a6031c
test: Explain why test logging should be used ffff9dcdc3MarcoFalke force-pushed on Mar 10, 2020fanquake approvedfanquake commented at 12:31 PM on March 10, 2020: memberre-ACK ffff9dcdc3cbe427739cc19cc7a53f032474fa2a
jonatack commented at 12:41 PM on March 10, 2020: memberACK ffff9dcdc3cbe427739cc19cc7a53f032474fa2a
instagibbs commented at 4:39 PM on March 10, 2020: memberMarcoFalke merged this on Mar 10, 2020MarcoFalke closed this on Mar 10, 2020MarcoFalke deleted the branch on Mar 10, 2020Fabcien referenced this in commit d46d359d3e on Aug 24, 2021DrahtBot locked this on Feb 15, 2022Contributors
github-metadata-mirror
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-17 06:14 UTC
This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me