-
Notifications
You must be signed in to change notification settings - Fork 121
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
Possible improvements to coverage task #340
Comments
thanks a lot. ya, seems like a lot of changes.
|
Totally understood. I do think the functionality might be something interesting to just pull into cargo-make... though we'd need to think about how that would work.
So I get a hang with my stuff, it might be something about the complexity of the tests, etc.
yes, this is just for the kcov build, it's really just the brew installs (requires brew, but most devs on mac use this now). |
if you want to investigate and maybe provide a pull request, that would be great.
i saw your script code, it looks good to me to have brew install it for mac. |
@bluejekyll sorry for the really late handling.
|
Cool! |
So, I've noticed a few issues with the kcov-coverage task that is in the default library. I don't feel comfortable putting up a PR against the base makefile toml, but would be happy to if you see it as desirable.
The first is that I believe coverage data is overwritten when multiple tests are run. The next is that the current grep match statement for collecting the tests isn't general enough. And finally, macOS is now supported, though I've personally run into issues with it, so continue to leave it disabled.
Overlapping coverage reports: I have two strategies for this. Create a new directory for each kcov run. First is a top coverage report per crate, then also a coverage directory for each test executable run. You'll notice that to facilitate this I broke out a script for kcov as well.
a) See here for the per crate target: https://github.com/bluejekyll/trust-dns/blob/master/Makefile.toml#L390-L396
b) See here for the per test crate: https://github.com/bluejekyll/trust-dns/blob/master/scripts/kcov.sh#L12-L13
For the test matching, I grabbed a project
cargo-with
which uses the metadata from cargo to get all the tests. I was thinking, we might want to grab all targets incargo-make
and build some ways of filtering those, and offering the ability to wrap those in the same way ascargo-with
, as I think it would be useful. Now I customized thecargo-with
project to run all tests with a given command, and that hasn't landed in that project yet.a) see install here: https://github.com/bluejekyll/trust-dns/blob/master/Makefile.toml#L98-L103
b) see usage here: https://github.com/bluejekyll/trust-dns/blob/master/Makefile.toml#L431-L432
c) the PR on
cargo-with
: Allow multiple executions for test targets cbourjau/cargo-with#29And finally, mac build, here's the install code I used for that. Now I found it beneficial to split the installer from the kcov task itself to ease testing the build of kcov, not sure if that's something you want: https://github.com/bluejekyll/trust-dns/blob/master/Makefile.toml#L137-L144
Also, thank you so much for this project. I think it's definitely the missing automation tool for Rust, and really fit my needs perfectly. I really appreciate your work on this. Thanks!
The text was updated successfully, but these errors were encountered: