-
Notifications
You must be signed in to change notification settings - Fork 24
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
How should we handle testing #9
Comments
@johnterickson on gitter
(doesn't matter, your thoughts are welcome!) |
From a CI perspective, a lot of people give flack for running From a completeness perspective, it is probably a problem to have an output format that doesn't support all of the events. Hmm, thinking about this. We could treat each bench as a test case and store the bench information in case properties. That way we can at least say we support it, even if people can't act on it. (I still feel like a benchmark reporting service is something lacking in the wider programming community)
For
|
This is a great clarifying point that reminds me of rust-lang/rust#57147. Zooming out for a second, i wonder if it's a hard requirement of libtest that the test output go to stdout. I think you make a good point that there will be too much mixing in stdout. Seems not very "rustic" to be having to grep from stdout mess. Perhaps libtest should have:
This would also solve the question of what to do about cargo's current "JSON-per-line" - specifically we could deprecate
My thought against a wrapper (not having tried suity or escargot (whose name I love btw)) Is more about having a way to generate programmatic test output out-of-box. That is, running tests in a CI shouldn't need me to "cargo install" something first. I'll have to try out suity and escargot! |
Understandable. Maybe I'm just being pessimistic but I expect we'll have quite a few thins to Speaking of, external tools might also be an important part of getting features integrated into cargo. if we have use cases to show we are solving along with a mature implementation, I expect that'll go through a lot more smoothly. Also, to be clear, to avoid the performance overhead of literally doing |
Criterion has a section about that. It doesn't give numbers, but basically says if you run cargo bench in a CI pipeline, it shouldn't fail a build. Speaking of Criterion, if we do support benchmarking in CI (of which I don't do but won't inhibit others), Criterion should really be the default / recommended. The fact that it outputs csv benchmark data (in addition to its other features) lends itself even more to a CI use case, as one could track benchmarks across all builds. For tests, from a UX perspective, I think I'd naturally gravitate towards seeing two steps "1. Run tests. 2. Upload test results / (3.?) code coverage" to differentiate potential failures, but I'm flexible. As long as any potential wrapper / tool is as solid as |
I'm on the fence on Criterion atm. Without the new testing RFC implemented and stable, it is error prone to maintain the list of benchmarks. I talked to them about adopting macros for registering tests but they want to just wait until the testing RFC is in. Otherwise, I think we're agnostic of the use of criterion.
Let me see if I understand. Is (3) the uploading of coverage or re-running the tests to collect coverage data? If the latter, the downside is we're doubling our testing time.
I agree. |
How does tarpaulin work? Does it wrap cargo test? Ideally this would all be some sort of middleware, but I'm not sure the best way to avoid re-running the test suite for code coverage and still receive test results and code coverage to upload. |
cargo-kcov wraps https://github.com/kennytm/cargo-kcov/blob/master/src/main.rs#L177 cargo-tarpaulin wraps https://github.com/xd009642/tarpaulin/blob/master/src/lib.rs#L99 |
Considerations
cargo test
's features that are relevant for CIsPossibilities
cargo test
The text was updated successfully, but these errors were encountered: