Skip to content

Add CI code coverage #21

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

Merged
merged 2 commits into from
Jul 16, 2017
Merged

Add CI code coverage #21

merged 2 commits into from
Jul 16, 2017

Conversation

willglynn
Copy link
Contributor

@willglynn willglynn commented Jul 15, 2017

This changeset changes the Travis CI config to run tests as usual, but assuming cargo test passes, it uses after_success: to download and build kcov, re-runs the test executable to collect code coverage info, and posts it to codecov.io.

Here's Travis build output and the codecov coverage report from this branch on my repo if you'd like to see what it looks like. All the after_success: stuff is all collapsed on Travis by default, so it's nowhere near as noisy as you might think based on the .travis.yml.

You would need to sign up with Codecov before merging, though like Travis, it's free for open source software.

Finally, it's worth noting that while the code coverage data is correct on a line by line basis, the code coverage statistics are incorrect (rust-lang/rust#39293). The coverage information shows which code paths get executed and which do not, but generic functions which were never codegen'd for the test executable do not count against the coverage percentage. For example, RudyMap shows 100% coverage… but the report also indicates that remove(), contains_key(), get_mut(), len(), and is_empty() are never called.

@codecov-io
Copy link

codecov-io commented Jul 15, 2017

Codecov Report

❗ No coverage uploaded for pull request base (master@2374879). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master      #21   +/-   ##
=========================================
  Coverage          ?   58.87%           
=========================================
  Files             ?       17           
  Lines             ?     1082           
  Branches          ?        0           
=========================================
  Hits              ?      637           
  Misses            ?      445           
  Partials          ?        0

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2374879...41658e5. Read the comment docs.

@willglynn
Copy link
Contributor Author

Oh. I guess you don't need to sign up, or maybe you already did.

@willglynn
Copy link
Contributor Author

I added some tests which exercise the RudyMap public interface and cause most other things to get generated. Coverage stats are now better, though the underlying issue remains.

@adevore adevore merged commit 6740cc9 into adevore:master Jul 16, 2017
@willglynn willglynn deleted the ci_code_coverage branch July 16, 2017 23:22
@adevore adevore added this to the 0.1 milestone Jul 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants