Skip to content
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

Save coverage even if tests fail #169

Closed
clarfonthey opened this issue May 28, 2022 · 2 comments · Fixed by #174
Closed

Save coverage even if tests fail #169

clarfonthey opened this issue May 28, 2022 · 2 comments · Fixed by #174
Labels
C-enhancement Category: A new feature or an improvement for an existing one

Comments

@clarfonthey
Copy link

It would be nice to have the option to be able to still generate coverage even if tests fail, since it can still be useful even if the code needs to be modified for them to pass. Right now, running cargo llvm-cov --html --open will not generate the coverage and not open it if the tests fail.

@taiki-e
Copy link
Owner

taiki-e commented May 29, 2022

This should already be available by using two commands, but I'm fine to add a specific option for it.

cargo llvm-cov --no-report --no-fail-fast || true
cargo llvm-cov --no-run --open

@taiki-e taiki-e added the C-enhancement Category: A new feature or an improvement for an existing one label May 29, 2022
@taiki-e
Copy link
Owner

taiki-e commented May 29, 2022

If we add an option for this (probably --ignore-run-fail?):

  • Only run failures should be ignored. i.e., a build failure should fail as usual.
    • This is what commands I mentioned in the above comment do not handle well.
    • To implement this, first run cargo test with --no-run flag, then run regular cargo test, ignoring only the latter error. (related code)
  • If this option is specified, the --no-fail-fast flag must be passed to cargo. (Without it, the test will be finished on failure.)
    • To avoid confusion, it is preferable to reject cases where both are used at the same time by using clap's conflicts option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: A new feature or an improvement for an existing one
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants