Skip to content
This repository was archived by the owner on Mar 2, 2020. It is now read-only.

Test Coverage #140

Closed
AzureMarker opened this issue May 13, 2019 · 6 comments
Closed

Test Coverage #140

AzureMarker opened this issue May 13, 2019 · 6 comments
Labels
tracking An issue used to track a feature, bug, or something else of note.

Comments

@AzureMarker
Copy link
Contributor

We currently lack insight into test coverage. We need to look into test coverage tools so we can measure how well the code is tested.

The recommended service to use is Codecov (example docs). It can be supplied data from kcov (see the example docs) or tarpaulin.

Supports #30

@AzureMarker AzureMarker added the tracking An issue used to track a feature, bug, or something else of note. label May 13, 2019
@AzureMarker
Copy link
Contributor Author

Tested tarpaulin on development. It fails the return_pthread_unlock_errors test in shared_lock.rs. On further inspection it seems to be an issue with tarpaulin, possibly related to xd009642/tarpaulin#190. After making some debugging changes to the test (printing out the unlock_result variable), it segfaults when run through tarpaulin.

@AzureMarker
Copy link
Contributor Author

Also tested kcov. It was a little harder to set up (more dependencies), but it didn't crash when I ran it.

On the bright side, our code coverage is somewhere around 82-83% (83.75% according to tarpaulin, 81.9% according to kcov).

@AzureMarker
Copy link
Contributor Author

I ran kcov through cargo-kcov, which provides an easy way to install and run kcov.

@AzureMarker
Copy link
Contributor Author

We may run into issues like the ones detailed here: interledger/interledger-rs#78

This is yet to be seen.

@AzureMarker
Copy link
Contributor Author

AzureMarker commented Jul 23, 2019

The IntelliJ Rust plugin recently added code coverage support (still in progress for CLion):
https://intellij-rust.github.io/2019/07/22/changelog-102.html

It uses grcov, which we may also be able to use.

image

@AzureMarker
Copy link
Contributor Author

AzureMarker commented Jul 23, 2019

When counting just lines, code coverage is about 84%. However, when counting branches such as those caused by the ? operator, code coverage is more around 69%. It may be hard to add coverage for some of these failure cases, especially when the failures are caused by writing to a file (ex. generating dnsmasq file).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
tracking An issue used to track a feature, bug, or something else of note.
Projects
None yet
Development

No branches or pull requests

1 participant