Skip to content

Conversation

@maflcko
Copy link
Member

@maflcko maflcko commented May 2, 2019

Need to be run with --coverage

@DrahtBot DrahtBot added the Tests label May 2, 2019
Copy link
Contributor

@jnewbery jnewbery left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK, although I'd prefer to reverse the defaults (ie only fail if a -failifuncoveredrpc or similar flag is passed)

@DrahtBot
Copy link
Contributor

DrahtBot commented May 2, 2019

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #15812 (Do not generate coverage report on test failures by crackercracked)

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.

@maflcko
Copy link
Member Author

maflcko commented May 2, 2019

Concept ACK, although I'd prefer to reverse the defaults (ie only fail if a -failifuncoveredrpc or similar flag is passed)

this is only active when --coverage is passed

@practicalswift
Copy link
Contributor

@MarcoFalke Will Travis fail if RPC has been added without tests?

@gmaxwell
Copy link
Contributor

gmaxwell commented May 3, 2019

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").

@maflcko
Copy link
Member Author

maflcko commented May 3, 2019

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.

@practicalswift
Copy link
Contributor

practicalswift commented May 3, 2019

Concept ACK

Agree with @MarcoFalke.

@jnewbery
Copy link
Contributor

jnewbery commented May 3, 2019

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.

Totally agree with this. The way to prevent bad test code being merged is to catch it at review.

@maflcko maflcko force-pushed the 1905-testFailNoRpcCov branch from fa20517 to fa054ba Compare May 3, 2019 17:45
Copy link
Contributor

@promag promag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK.

Currently failing with

Uncovered RPC commands:
  - pruneblockchain

@maflcko maflcko force-pushed the 1905-testFailNoRpcCov branch 3 times, most recently from faffa16 to fa7ea62 Compare May 14, 2019 21:36
@maflcko
Copy link
Member Author

maflcko commented May 15, 2019

@practicalswift
Copy link
Contributor

utACK fa7ea62

Copy link
Member

@jonatack jonatack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK

@jonatack
Copy link
Member

Note that testing a single file through the runner with --coverage outputs something like this: https://gist.github.com/jonatack/f6fd73d25ebfc8222ab3594cc322735c

@maflcko
Copy link
Member Author

maflcko commented May 15, 2019

That is expected and I don't think I changed that in this pull request?

@jonatack
Copy link
Member

Gotcha. Doing more testing.

Copy link
Contributor

@ryanofsky ryanofsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@maflcko maflcko force-pushed the 1905-testFailNoRpcCov branch from fa7ea62 to fad0ce5 Compare May 15, 2019 18:29
Copy link
Contributor

@ryanofsky ryanofsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK fad0ce5. New comment in travis.yml is the only change since last review.

maflcko pushed a commit to maflcko/bitcoin-core that referenced this pull request May 15, 2019
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
@maflcko maflcko merged commit fad0ce5 into bitcoin:master May 15, 2019
@maflcko maflcko deleted the 1905-testFailNoRpcCov branch May 15, 2019 19:53
deadalnix pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Apr 16, 2020
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
ftrader pushed a commit to bitcoin-cash-node/bitcoin-cash-node that referenced this pull request Aug 17, 2020
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
dzutto pushed a commit to dzutto/dash that referenced this pull request Oct 12, 2021
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
UdjinM6 added a commit to dashpay/dash that referenced this pull request Oct 13, 2021
pravblockc pushed a commit to pravblockc/dash that referenced this pull request Nov 18, 2021
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
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Dec 16, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants