Need test for rpcauth.py #12995

issue laanwj opened this issue on April 16, 2018
  1. laanwj commented at 2:31 PM on April 16, 2018: member

    There is no test for the share/rpcauth/rpcauth.py script, there should be one, and it should be part of travis.

  2. laanwj added the label Tests on Apr 16, 2018
  3. laanwj added the label Scripts and tools on Apr 16, 2018
  4. laanwj added the label good first issue on Apr 16, 2018
  5. cdecker commented at 11:57 AM on April 18, 2018: contributor

    I'd like to take a stab at this, but I could use some guidance. Would this be better suited in test/util or test/functional? The latter is a bit heavier but it'd allow us to also check the correctness of the generated credentials.

  6. MarcoFalke commented at 1:05 PM on April 18, 2018: member

    We have a test in ./test/functional/rpc_users.py that has the rpcauth hardcoded. It could make sense to call into rpcauth.py and generate a fresh pair every time the test is executed.

  7. cdecker commented at 3:55 PM on April 19, 2018: contributor

    Sounds like a plan, I'll take a look at it ^^

    Edit: Damn, too slow :wink:

  8. MarcoFalke removed the label good first issue on Apr 19, 2018
  9. jnewbery commented at 9:10 PM on April 19, 2018: member

    I'm NACKish on adding dependencies to the functional test framework, even if they're on internal project tools. Currently the functional tests can run anywhere. I don't think we should be adding a requirement that the /share directory is available (and certainly shouldn't be hard-coding its location relative to the test file).

  10. nixbox commented at 6:40 PM on April 22, 2018: contributor

    If I were to add unit testing for rpcauth.py, where would that go in the directory structure?

    To be more specific, since most python tests are functional tests and reside under test/functional, if i were to put the unittest for rpcauth.py under test/util, I would have no way of referencing definitions in rpcauth.py without mucking with PYTHONPATH or sys.path.

    Is it OK to put the unittest instead under share/test and then use the python unittest discover functionality to run the test?

    Any feedback would be appreciated.

  11. jnewbery commented at 10:12 PM on April 22, 2018: member

    If I were to add unit testing for rpcauth.py, where would that go in the directory structure?

    I see two options:

    1. Within the rpcauth.py module itself, using the Python standard library unittest module.
    2. In test/util, by adding the location of rpcauth.py to config.ini.in (as in https://github.com/bitcoin/bitcoin/pull/13024/commits/6be22e7db3ac815356ba14298d551bfae0e7a74c#diff-914785539d91e7b1d7ec0614606b03eeR12) and then updating sys.path.

    In either case, you should update make check to run the test.

  12. laanwj closed this on Apr 24, 2018

  13. laanwj referenced this in commit 018c7e5dad on Apr 24, 2018
  14. laanwj referenced this in commit 106d929780 on Apr 25, 2018
  15. stamhe referenced this in commit c9333f3aef on Jun 27, 2018
  16. HashUnlimited referenced this in commit 8c75cfc5f6 on Sep 6, 2018
  17. lionello referenced this in commit 79a99130f5 on Nov 7, 2018
  18. joemphilips referenced this in commit 6e355bcd0f on Nov 9, 2018
  19. PastaPastaPasta referenced this in commit 69651c36a0 on Jul 19, 2020
  20. PastaPastaPasta referenced this in commit da37f120c6 on Jul 19, 2020
  21. PastaPastaPasta referenced this in commit 46c368b8f1 on Jul 22, 2020
  22. PastaPastaPasta referenced this in commit d57503e469 on Jul 22, 2020
  23. MarcoFalke locked this on Sep 8, 2021
  24. gades referenced this in commit d3ecd3a95c on Mar 11, 2022

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-13 18:15 UTC

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