docs: Improvements to two READMEs in /test #15830

pull merland wants to merge 1 commits into bitcoin:master from merland:patch-1 changing 2 files +29 −19
  1. merland commented at 1:27 PM on April 16, 2019: contributor

    Before

    • Most commands in test/README.md are relative to the repo root, but not all.
    • The locations of the log files are not described.

    After

    • All commands are relative to the repo root.
    • Info about the location of the test framework log files has been added.
  2. merland renamed this:
    Improvements to test/README.md
    docs: Improvements to test/README.md
    on Apr 16, 2019
  3. fanquake added the label Docs on Apr 16, 2019
  4. in test/README.md:127 in d6d715eb80 outdated
     124 |  The tests contain logging at different levels (debug, info, warning, etc). By
     125 |  default:
     126 |  
     127 |  - when run through the test_runner harness, *all* logs are written to
     128 | -  `test_framework.log` and no logs are output to the console.
     129 | +  test_framework.log` and no logs are output to the console.
    


    practicalswift commented at 1:39 PM on April 16, 2019:

    This change wasn't intentional? :-)


    jonatack commented at 1:53 PM on April 16, 2019:

    Typo, agreed :)


    merland commented at 6:22 PM on April 16, 2019:

    Indeed! Fixed.

  5. practicalswift commented at 1:44 PM on April 16, 2019: contributor

    Concept ACK

    Thanks for improving the documentation!

  6. in test/README.md:121 in d6d715eb80 outdated
     117 |  
     118 | +The test framework logs to two files: 
     119 | + * `<test data directory>/test_framework.log` 
     120 | + * `<test data directory>/<node>/regtest/debug.log`. 
     121 | + 
     122 | +The `<test data directory>` path is by default set to the temporary directory of your OS, and its full path is written as the very first line of the test output. The `<node>` part identifies the relevant test node (from `node1` to `node4`).  
    


    jonatack commented at 1:50 PM on April 16, 2019:

    Would be nice to stay within the max line length seen in the source file. It shouldn't change the result in markdown but the source will be easier to read.


    merland commented at 6:22 PM on April 16, 2019:

    Agreed! Fixed.

  7. in test/README.md:119 in d6d715eb80 outdated
     115 |  
     116 |  ##### Test logging
     117 |  
     118 | +The test framework logs to two files: 
     119 | + * `<test data directory>/test_framework.log` 
     120 | + * `<test data directory>/<node>/regtest/debug.log`. 
    


    jonatack commented at 1:52 PM on April 16, 2019:

    Perhaps replace <node> with node<number> here and in the following sentence.


    merland commented at 6:23 PM on April 16, 2019:

    Good idea! Made it so.

  8. jonatack commented at 2:00 PM on April 16, 2019: member

    Concept ACK. Filenames from root seems clearer to me too, though I don't have a strong opinion. Note that in test/functional/README there are non-root filenames as well, so if consensus is in that direction why not update both.

  9. merland force-pushed on Apr 16, 2019
  10. merland commented at 6:27 PM on April 16, 2019: contributor

    Note that in test/functional/README there are non-root filenames as well, so if consensus is in that direction why not update both.

    Good find. I'll try do make it happen, but I'd rather do it in another PR. Keeping things small.

  11. in test/README.md:122 in 835d5fd3f3 outdated
     118 | +The test framework logs to two files: 
     119 | + * `<test data directory>/test_framework.log` 
     120 | + * `<test data directory>/node<number>/regtest/debug.log`. 
     121 | + 
     122 | +The `<test data directory>` path is by default set to the temporary directory of
     123 | +your OS, and its full path is written as the very first line of the test output.
    


    MarcoFalke commented at 6:32 PM on April 16, 2019:

    It is not of the OS, but rather of the python environment. And it can be overwritten via a parameter to the test (runner)


    jonatack commented at 6:47 PM on April 16, 2019:

    Suggestion: "its full path is provided in the first line of the test output."


    merland commented at 7:09 PM on April 16, 2019:

    Well, the python tempfile module is used to achieve cross-platform support, but the current phrasing "...is by default set to the temporary directory of your OS" is still valid, IMO.

    Regarding the overwriting ability: My thinking was that adding "by default" would suggest to the reader that there are other options (which are mentioned elsewhere). Brevity is nice but I could add more info if you think it is needed.


    merland commented at 7:17 PM on April 16, 2019:

    Suggestion: "its full path is provided in the first line of the test output."

    Agreed, better! Fixed.


    MarcoFalke commented at 7:21 PM on April 16, 2019:

    Yeah, no strong opinion. Just for reference: https://docs.python.org/3.8/library/tempfile.html#tempfile.gettempdir

  12. MarcoFalke commented at 6:32 PM on April 16, 2019: member

    ACK, but I agree that both files should be fixed up. I think 12 lines to review is small enough to include more changes.

  13. in test/README.md:123 in 835d5fd3f3 outdated
     119 | + * `<test data directory>/test_framework.log` 
     120 | + * `<test data directory>/node<number>/regtest/debug.log`. 
     121 | + 
     122 | +The `<test data directory>` path is by default set to the temporary directory of
     123 | +your OS, and its full path is written as the very first line of the test output.
     124 | +The `node<number>` part identifies the relevant test node (from `node1` to`node4`).
    


    jonatack commented at 6:45 PM on April 16, 2019:

    Add a space after "to" here: to`node4`


    merland commented at 7:10 PM on April 16, 2019:

    ACK, but I agree that both files should be fixed up. I think 12 lines to review is small enough to include more changes. @MarcoFalke Fair enough. I'll look into it!


    merland commented at 7:16 PM on April 16, 2019:

    @jonatack Thanks, fixed! (blush)

  14. merland force-pushed on Apr 16, 2019
  15. merland force-pushed on Apr 16, 2019
  16. merland force-pushed on Apr 17, 2019
  17. merland commented at 8:15 AM on April 17, 2019: contributor

    Note that in test/functional/README there are non-root filenames as well, so if consensus is in that direction why not update both. @MarcoFalke Made some changes to test/functional/README.md, which is a bit different in character compared to test/README.md. I tried to keep the text as readable as possible while still informing the reader about the location of each file. I used both full path and linking, depending on textual context (Do we want the the reader to look at the file or issue a command in a terminal?). All links still work when read from GitHub.

  18. in test/README.md:121 in 65991dd812 outdated
     117 |  
     118 | +The test framework logs to two files: 
     119 | + * `<test data directory>/test_framework.log` 
     120 | + * `<test data directory>/node<number>/regtest/debug.log`. 
     121 | + 
     122 | +The `<test data directory>` path is by default set to the temporary directory of
    


    jonatack commented at 9:54 AM on April 17, 2019:

    This paragraph could be shorter, and omit the OS part, along the lines of:

    "The first line of the test output provides the test data directory path. The node number is the relevant test node from node1 to node4."


    merland commented at 10:54 AM on April 17, 2019:

    Brevity is key, but personally I think your suggestion would be taking it too far. IMO most readers would be interested in the OS part. Anyone else?


    merland commented at 11:40 AM on April 23, 2019:

    @jonatack I went with your suggestion here (with an added comma), due to opinion not strong enough :)

  19. in test/functional/README.md:7 in 65991dd812 outdated
       3 | @@ -4,13 +4,13 @@
       4 |  
       5 |  #### Example test
       6 |  
       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.
      10 | +The python script [test/functional/example_test.py](example_test.py) is a heavily commented example
    


    jonatack commented at 9:57 AM on April 17, 2019:

    It's a test file. I'd suggest "The file test/functional/example_test.py is a ..." or just begin with the link.


    merland commented at 10:49 AM on April 17, 2019:

    Fixed, thanks.

  20. in test/functional/README.md:85 in 65991dd812 outdated
      81 | @@ -82,7 +82,7 @@ P2P messages. These can be found in the following source files:
      82 |  
      83 |  #### Using the P2P interface
      84 |  
      85 | -- `messages.py` contains all the definitions for objects that pass
      86 | +- [messages.py](test/functional/test_framework/messages.py) contains all the definitions for objects that pass
    


    jonatack commented at 10:00 AM on April 17, 2019:

    Are the label and link inverted here?


    jonatack commented at 10:18 AM on April 17, 2019:

    (the contents)


    merland commented at 10:45 AM on April 17, 2019:

    No, but the link was a bit off. Fix coming shortly.

  21. in test/functional/README.md:102 in 65991dd812 outdated
      95 | @@ -96,32 +96,33 @@ the Bitcoin Core node application logic. For custom behaviour, subclass the
      96 |  P2PInterface object and override the callback methods.
      97 |  
      98 |  - Can be used to write tests where specific P2P protocol behavior is tested.
      99 | -Examples tests are `p2p_unrequested_blocks.py`, `p2p_compactblocks.py`.
     100 | +Examples tests are [p2p_unrequested_blocks.py](p2p_unrequested_blocks.py), [p2p_compactblocks.py](p2p_compactblocks.py).
     101 |  
     102 | -### test-framework modules
     103 | +### Test framework modules
     104 | +The following are some useful modules for test developers. They are all located in [test/functional/test_framework](test_framework/) 
    


    jonatack commented at 10:14 AM on April 17, 2019:

    Missing punctuation at end of the line. For brevity can omit "some" and "all". Would it be better to add a slash at the end of the test/functional/test_framework/ label?


    jonatack commented at 10:15 AM on April 17, 2019:

    Ideally limit line lengths to 120 chars.


    merland commented at 10:49 AM on April 17, 2019:

    Thanks for your feedback. Fixed.

  22. merland force-pushed on Apr 17, 2019
  23. merland commented at 11:36 AM on April 17, 2019: contributor

    squashed

  24. merland force-pushed on Apr 23, 2019
  25. merland commented at 11:43 AM on April 23, 2019: contributor

    All feedback has been adressed, can this PR be merged?

  26. MarcoFalke commented at 11:48 AM on April 23, 2019: member

    The tests don't pass

  27. merland renamed this:
    docs: Improvements to test/README.md
    docs: Improvements to two READMEs in /test
    on Apr 23, 2019
  28. merland force-pushed on Apr 23, 2019
  29. Describe log files + consistent paths 627bf65b07
  30. merland force-pushed on Apr 23, 2019
  31. merland commented at 1:27 PM on April 23, 2019: contributor

    Missed the little red X again.... Fixed some linting errors.

  32. merland commented at 1:13 PM on May 14, 2019: contributor

    All feedback has been adressed, can this PR be merged?

  33. in test/README.md:122 in 627bf65b07
     118 | +The test framework logs to two files:
     119 | + * `<test data directory>/test_framework.log`
     120 | + * `<test data directory>/node<number>/regtest/debug.log`.
     121 | +
     122 | +The first line of the test output provides the test data directory path. The
     123 | +node number is the relevant test node, from node1 to node4.
    


    MarcoFalke commented at 1:21 PM on May 14, 2019:

    tests can set their own number of nodes and it starts at node0, btw

  34. merland commented at 9:54 AM on May 17, 2019: contributor

    I decided to close this PR. Thanks for all the good feedback but I feel it grew too much. Not in number of lines but in number of comments and elapsed calendar time. If someone wants to use these ideas in another PR, please feel free to do so! (Or reopen this one.)

  35. merland closed this on May 17, 2019

  36. fanquake added the label Up for grabs on May 17, 2019
  37. fanquake removed the label Up for grabs on Oct 17, 2019
  38. MarcoFalke referenced this in commit 88eff969c2 on Oct 17, 2019
  39. DrahtBot locked this on Dec 16, 2021

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-15 15:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me