There is no test for the share/rpcauth/rpcauth.py script, there should be one, and it should be part of travis.
-
laanwj commented at 2:31 PM on April 16, 2018: member
- laanwj added the label Tests on Apr 16, 2018
- laanwj added the label Scripts and tools on Apr 16, 2018
- laanwj added the label good first issue on Apr 16, 2018
-
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/utilortest/functional? The latter is a bit heavier but it'd allow us to also check the correctness of the generated credentials. -
MarcoFalke commented at 1:05 PM on April 18, 2018: member
We have a test in
./test/functional/rpc_users.pythat has the rpcauth hardcoded. It could make sense to call intorpcauth.pyand generate a fresh pair every time the test is executed. -
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:
- MarcoFalke removed the label good first issue on Apr 19, 2018
-
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
/sharedirectory is available (and certainly shouldn't be hard-coding its location relative to the test file). -
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.
-
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:
- Within the
rpcauth.pymodule itself, using the Python standard library unittest module. - 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 updatingsys.path.
In either case, you should update make check to run the test.
- Within the
- laanwj closed this on Apr 24, 2018
- laanwj referenced this in commit 018c7e5dad on Apr 24, 2018
- laanwj referenced this in commit 106d929780 on Apr 25, 2018
- stamhe referenced this in commit c9333f3aef on Jun 27, 2018
- HashUnlimited referenced this in commit 8c75cfc5f6 on Sep 6, 2018
- lionello referenced this in commit 79a99130f5 on Nov 7, 2018
- joemphilips referenced this in commit 6e355bcd0f on Nov 9, 2018
- PastaPastaPasta referenced this in commit 69651c36a0 on Jul 19, 2020
- PastaPastaPasta referenced this in commit da37f120c6 on Jul 19, 2020
- PastaPastaPasta referenced this in commit 46c368b8f1 on Jul 22, 2020
- PastaPastaPasta referenced this in commit d57503e469 on Jul 22, 2020
- MarcoFalke locked this on Sep 8, 2021
- gades referenced this in commit d3ecd3a95c on Mar 11, 2022