-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
cargo test: Don't re-run tests that already passed #10673
Comments
I suspect this is more of a libtest concern but there is the issue of cargo running all of the libtest binaries. |
For my use case, the libtest binary is a fine level of granularity to cache the results of. Caching individual |
IIRC, I know that in JavaScript world, a famous test framework jest gets a shiny watch mode that let you re-run failure tests or a portion of filtered tests in the same interactive session. However, even jest re-runs all tests if you re-invoke the command, so I doubt that cargo should skip passed tests across invocations. Anyway, this is great advice. The field of test framework in Rust is still young. Maybe there are already some similar tools in Rust. Really looking forwards to some external-command doing what jest does :) |
For other prior art,
See https://docs.pytest.org/en/7.1.x/reference/reference.html#command-line-flags Users opt-in to running failed tests so invalidation isn't a concern. |
Is there a way to give it access to these things? +1 This feature. In
|
Probably kinda a duplicate of #6826. This has got more discussions so close that in favor of this. I'd say the relationship between libtest and cargo-test is a bit unclear and there is no obvious progress so far. Some experiments (https://github.com/epage/pytest-rs) and well-developed alternative (https://nexte.st/) are out there. You may want to take a look. |
Thanks @weihanglo. For reference here's the corresponding issue in Nextest nextest-rs/nextest#174 |
One way to support this would to add a flag to |
While T-testing-devex is still establishing a plan, my expectation for how something like this would work: once libtest has stable json output and cargo leverages it for taking on more responsibilities of libtest, third-party test runners would experiment with what can/should be done in this space and as the design space is explored, we can consider what to include within |
For more prior art, I would like to throw in a shameless plug: over the past year I've worked on |
This is a great idea. Strong feature for TDD. |
Does the compiler support tracing which symbols/functions were invalidated? |
ocaml/dune does this ocaml/dune#4390 (comment) |
Problem
I have a large workspace in which there's a crate with several long-running property tests. This makes
cargo test --workspace
take unreasonably long in the common case where those property tests haven't been touched.Proposed Solution
Cache the test results, so that
cargo test --workspace
can complete quickly in the common case where long-running tests haven't been touched.Notes
Related work:
The text was updated successfully, but these errors were encountered: