-
Notifications
You must be signed in to change notification settings - Fork 988
Adding kcov code coverage to chain and core modules #115
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #115 +/- ##
=======================================
Coverage ? 0%
=======================================
Files ? 39
Lines ? 4580
Branches ? 0
=======================================
Hits ? 0
Misses ? 4580
Partials ? 0 Continue to review full report at Codecov.
|
.travis.yml
Outdated
after_success: | | ||
pwd && | ||
echo "HERE" && | ||
wget https://github.com/percytheprefect/kcov/archive/master.tar.gz && |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@percytheprefect Nice initiative.
I'm interested to work more on this. I'm sesam on grin's gitter chat. |
I found https://github.com/huonw/travis-cargo which probably does more or less the same, but may be even more outdated. The opensource way to solve this would be upstreaming fixes to @huonw or someone who can take over that burden. I also found https://crates.io/crates/cargo-tarpaulin (linux x86-only) and tried:
with no success when tested on mostly vanilla Debian Jessie. |
@codecov-io aboev has outdated links. The link to the "full report" is https://codecov.io/gh/mimblewimble/grin/pull/115 and that is still reporting "missing base report". |
@sesam : I think tarpaulin is a good option: actively maintained and aiming for functionality that Regarding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@percytheprefect @ignopeverell :
-
Any plans for this PR? I'm interested in picking this up or collaborating by chatting regularly with @sesam.
-
Regarding this PR's approach to coverage: any interest in maintaining our own fork of
kcov
? Re: @percytheprefect 's comment:
If you want to fork the repo so that we can use your fork as our reference repository that is fine too.
I asked around and several projects appear to have accepted SimonKagstrom/kcov
as a standard, if somewhat slow. From another blog, jbp.io, using LLVM:
Prior to this work, I used kcov. This produced good output, but each test process took around three seconds to start. One of the test suites runs around 1000 processes, so this meant a full test run took almost an hour (compared to 50 seconds without coverage).
So if we want to stick to the approach put forth in this PR, I think using kcov
should be fine.
- Unrelated to this PR, in Unit Tests for API endpoints #434 @sesam mentioned adding a fuzzer using quickcheck -- I'd be interested in exploring this as well. Do we have the same concerns with ownership of forks? It feels like a separate project to me -- might it make sense as a separate issue?
I found kennytm/cov
, which is more recent and appears to have some acceptance in the community. See this rfc to see the progression over the last few years. It also supports more targets than linux/x86.
You can try it locally, like this:
cargo install cargo-cov
cargo cov clean
cargo cov test
cargo cov report --open
I figure it's best to check with you two, as I'm new to the project. Do the results here, for core/src
look accurate (or at least not wildly off...)?
If so, I can explore automating the processing/upload of coverage results, similar to what is described in the jbp.io
blog post linked above.
For now, we can use this locally to help make decisions about what needs more testing. Thoughts?
Hey @sdtsui, thanks for picking this up with @sesam. I would have no problem having our own fork of |
I might try to convince @hendi once back from newyears busyness to set up a
cargo-cov on his machines
…On Dec 24, 2017 20:21, "Ignotus Peverell" ***@***.***> wrote:
Hey @sdtsui <https://github.com/sdtsui>, thanks for picking this up with
@sesam <https://github.com/sesam>. I would have no problem having our own
fork of kcov but it sounds like cargo-cov is a better option now. Am I
reading this right? The report you pasted looks pretty good to me and seems
about right. Is there any publicly hosted option for cargo-cov? Could we
somehow integrate it with travis?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#115 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAi2aXVkTI1BLU0xsmHh_zBQG49_c-mks5tDqQ-gaJpZM4PMJpi>
.
|
@ignopeverell I did some more reading today, looking deeper into the different projects we could use.
Hosted publically on crates.io: I'm not sure if we should use this after all, especially given Also note that @ignopeverell Sound ok? |
Fixing bug in .yml file Adding cargo test --no-run command to after_success Removing comment, adding pwd to see what working directory is Debugging working directory for .yml file Replacing binutils with libbfd-dev Removing libbfd-dev because it fails the build Adding test coverage to rest of grin modules
071a595
to
f3d3b34
Compare
I think we should choose the simplest solution. We do not want to allocate many resources to fiddle with code coverage. @sdtsui you will need to rebase your #545 onto this new commit. I have added coverage to other modules in the grin codebase.
This is a good idea. Grin's testing procedures have been lacking. Property based testing, in conjunction with a few hard coded test vectors, is a proven way to build high quality software. I'm guessing quickcheck will unearth some tricky bugs in our implementation. We should start with writing properties for our cryptographic primitives and serializers and work our way out from there. |
Ended up merging #545, please PR on top of master to add new modules, improvements, etc. Definitely agree we should ramp up testing as much as possible and quickcheck has its place there. |
cargo test --no-run && | ||
cd ../ | ||
pwd && | ||
kcov --exclude-pattern=/.cargo,/usr/lib --verify target/cov target/debug/grin_core* && |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This pull request implements code coverage for the core and chain modules of grin. It follows this guide to implement the test coverage.
If anyone knows of a better way to make code coverage easily accessible for grin let me know.