tests: Fail if RPC has been added without tests#15943
Conversation
jnewbery
left a comment
There was a problem hiding this comment.
Concept ACK, although I'd prefer to reverse the defaults (ie only fail if a -failifuncoveredrpc or similar flag is passed)
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
this is only active when --coverage is passed |
|
@MarcoFalke Will Travis fail if RPC has been added without tests? |
|
A concern that comes to mind is that if travis is just arbitrarily failing on new rpc's "without tests" it's going to encourage adding more pre-textual tests that don't really test anything and just run the rpc, or which inappropriately hardcode some output ("software changed detection"). |
|
This is already an issue with the existing coverage report, which motivated people to test for exact verbose responses. Though, I have a slight hope that review might catch those before merge. If it doesn't we have at least a test as opposed to no test and get notified of the issue the next time the response changes. |
|
Concept ACK Agree with @MarcoFalke. |
Totally agree with this. The way to prevent bad test code being merged is to catch it at review. |
fa20517 to
fa054ba
Compare
promag
left a comment
There was a problem hiding this comment.
Concept ACK.
Currently failing with
Uncovered RPC commands:
- pruneblockchain
faffa16 to
fa7ea62
Compare
|
Addressed @jnewbery and @promag feedback. Example output is here: https://travis-ci.org/bitcoin/bitcoin/jobs/532518417#L3769 |
|
utACK fa7ea62 |
|
Note that testing a single file through the runner with --coverage outputs something like this: https://gist.github.com/jonatack/f6fd73d25ebfc8222ab3594cc322735c |
|
That is expected and I don't think I changed that in this pull request? |
|
Gotcha. Doing more testing. |
ryanofsky
left a comment
There was a problem hiding this comment.
utACK fa7ea62
going to encourage adding more pre-textual tests that don't really test anything and just run the rpc
IMO, while this is a legitimate concern, if the ultimate goal is to have meaningful tests for all RPCs, it's often a lot easier to start from a minimal test and extend it to be more interesting, than to have to start from scratch and have to figure out how to create a context where the RPC can be called at all.
fa7ea62 to
fad0ce5
Compare
fad0ce5 tests: Fail if RPC has been added without tests (MarcoFalke) Pull request description: Need to be run with --coverage ACKs for commit fad0ce: ryanofsky: utACK fad0ce5. New comment in travis.yml is the only change since last review. Tree-SHA512: b53632dfe9865ec06991bfcba2fd67238bebbb866b355f09624eaf233257b2bca902caac6c24abb358b2f4c1c43f28ca75e30982765911e1a117102df65276d9
Summary:
fad0ce59e9 tests: Fail if RPC has been added without tests (MarcoFalke)
Pull request description:
Need to be run with --coverage
ACKs for commit fad0ce:
ryanofsky:
utACK fad0ce59e9154f9b7e61907a71c740a942c60282. New comment in travis.yml is the only change since last review.
Tree-SHA512: b53632dfe9865ec06991bfcba2fd67238bebbb866b355f09624eaf233257b2bca902caac6c24abb358b2f4c1c43f28ca75e30982765911e1a117102df65276d9
Backport of Core [[bitcoin/bitcoin#15943 | PR15943]]
Test Plan:
test_runner.py --coverage --extended
Verify `All RPC commands covered.` is printed to the console.
Reviewers: O1 Bitcoin ABC, #bitcoin_abc, Fabien
Reviewed By: O1 Bitcoin ABC, #bitcoin_abc, Fabien
Differential Revision: https://reviews.bitcoinabc.org/D5743
fad0ce59e9 tests: Fail if RPC has been added without tests (MarcoFalke) Need to be run with --coverage Backport of Core [PR15943](bitcoin/bitcoin#15943) Test Plan: ``` test_runner.py --coverage --extended ``` Verify `All RPC commands covered.` is printed to the console. Differential Revision: https://reviews.bitcoinabc.org/D5743
fad0ce5 tests: Fail if RPC has been added without tests (MarcoFalke) Pull request description: Need to be run with --coverage ACKs for commit fad0ce: ryanofsky: utACK fad0ce5. New comment in travis.yml is the only change since last review. Tree-SHA512: b53632dfe9865ec06991bfcba2fd67238bebbb866b355f09624eaf233257b2bca902caac6c24abb358b2f4c1c43f28ca75e30982765911e1a117102df65276d9
Merge bitcoin PRs: bitcoin#14683, bitcoin#15841, bitcoin#14984 and bitcoin#15943
fad0ce5 tests: Fail if RPC has been added without tests (MarcoFalke) Pull request description: Need to be run with --coverage ACKs for commit fad0ce: ryanofsky: utACK fad0ce5. New comment in travis.yml is the only change since last review. Tree-SHA512: b53632dfe9865ec06991bfcba2fd67238bebbb866b355f09624eaf233257b2bca902caac6c24abb358b2f4c1c43f28ca75e30982765911e1a117102df65276d9
Need to be run with --coverage