-
Notifications
You must be signed in to change notification settings - Fork 666
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CI: Add code coverage #2410
Comments
This issue is really not actionable in any way. In most cases bugs highlight missing test cases, there is like a natural connection between broken things and missing tests. If you have a better issue with more ideas or whatever, please open it. |
I mean measure test coverages so we will know if there are code that’s completely untested. it is not the most useful matrix but better than not having it |
for example, we have this in orml open-web3-stack/open-runtime-module-library#966 (comment) |
@bkchr can you reopen this? unless you need me to provide more details |
I don't follow the assumption that showing the test coverage will prevent the introduction of bugs. These metrics are quite obscure, especially when we here run things as well in wasm and whatever that will not be tracked by this tool and thus reduce actually the test coverage. |
100% coverage does not mean no bug, but an uncovered code always requires an extra look. For example, a PR that introduce a new pallet, if with coverage available, I will spend extra time review untested code and make sure there are good reason that they are not covered in unit tests. This is especially important to ensure consistent high quality code in such big repo. As you might have guessed, I am a bit disappointed with code quality in some of the code in this repo and want to find good ways to improve it without requiring me or you to review all the code. |
Okay fine. |
@alvicsam maybe something you would like to work on? Not sure we should use codecov. |
Sure, I'll take a look. Out of curiosity: why not codecov? |
IDK. We can also use it. Not sure about their plans/costs. But if they are free for open source projects, we can probably use them |
Ah, I think this would be useful. Not that we have to test every line, but it can help us determine what's been overlooked in the tests. In async backing for example it turned out we have whole functions that were entirely untested. More reading here. There is just a problem that coverage chokes on wasm, so not all crates can use it. And FYI, we have some instructions in the Contribution doc about code coverage. They are pretty old, but worth checking because there are some workarounds for wasm. (Didn't work for me, but maybe it was something on my end.) |
I experimented in this PR. After I add
Also with this flag tests take 2x time (about 1-1,5h) |
I dont know if it makes sense to run the node tests for coverage? |
Yeah I don't think we really need coverage for integration tests |
Some updates. These features are already on master: So, if everyone is okay with this, we could try to move tests to coverage jobs during GHA migration |
So we know if there are missing tests. It seems like the test coverage can be very bad for many pallets. e.g. #2405 did not break any existing tests in pallet-xcm
The text was updated successfully, but these errors were encountered: