4 ms·
Cargo-nextest: 3x faster than cargo test, per-test isolation, first-class CI
- esafak 3mo agoAnybody using this in production? edit: Thanks, will try!
- tekacs 3mo agoYes, for a long while – I believe it's fairly widely used (and it's absolutely excellent!)
- merqurio 3mo agoHappy user here !
- DennisL123 3mo agoYes, been using it for 18’ish months. Works great.
- aabhay 3mo agoYep. Tokio uses it for their tests in CI as well last I checked.
- musicmatze 3mo agoBeen using it for years, for opensource stuff and at work. No issues whatsoever.
- gdcbe 3mo agoYes we use it for rama [1]. You can check its justfile and CI workflow file how we use it. Those run thousands and thousands of tests thx to nextest and what feels like instantly (once compiled). Large projects build with rama use it as well. But those are proprietary from partners so sadly cannot share those. [1]: https://github.com/plabayo/rama https://github.com/plabayo/rama
- patates 3mo agoI somehow tried to make sense of the name as a superlative form of "next". Perhaps next-test would have been fine?
- sunshowers 3mo agoThat is indeed the pun =)
- patates 3mo agoOh, sorry then, thanks for the clarification :)
- mightyham 3mo agoComing from the DC area, this comment reminds me of how the metro payment system "Smartrip" was recently renamed to "Smart Trip".
- sunshowers 3mo agoThanks for posting about this! I'm the main author of nextest, and it represents my best foot forward for how Rust testing should be done. Happy to answer questions though I might be a bit intermittent.
- mrec 3mo agoHave there been any discussions about upstreaming this into cargo proper? Are there any significant downsides to nextest compared to its predecessor?
- sunshowers 3mo agoThe How it works [1] and Why process-per-test? [2] pages should answer your questions. [1] https://nexte.st/docs/design/how-it-works/ https://nexte.st/docs/design/how-it-works/ [2] https://nexte.st/docs/design/why-process-per-test/ https://nexte.st/docs/design/why-process-per-test/
- mrec 3mo agoAh, I see. You're aiming to become the hashbrown of testing.
- sunshowers 3mo agoOh gosh, were we to be so lucky :) just aiming to solve problems my coworkers and users see, and doing it with care, is all.
- landr0id 3mo agoBig fan of nextest and this is my first time seeing this site. I'll be real I feel a bit ridiculous commenting this but you might want to consider rephrasing this: >Treat tests as cattle, not pets. Detect and terminate slow tests. Not sure saying, "hey, treat your tests as an animal you can kill at will" paints the right image.
- 3mo ago
- satvikpendem 3mo agoI love nextest, it's been great. This along with bacon catches a lot of issues.
- weinzierl 3mo agoThe "execution model" page[1] is documentation at its best! It answered 90% of the questions I had at the monent. Thank you! [1] https://nexte.st/docs/design/how-it-works/ https://nexte.st/docs/design/how-it-works/
- mohsen1 3mo agoI love nextest. without it my CI could take hours https://github.com/tsz-org/tsz/actions/runs/29002057457/job/86064715984 https://github.com/tsz-org/tsz/actions/runs/29002057457/job/... watch it running 32.5k unit tests without breaking a sweat!
- sunshowers 3mo agoThanks! BTW you might enjoy setting CARGO_TERM_COLOR=always in your environment :) dtolnay/rust-toolchain does this automatically but it looks like you aren't using that action.
- mohsen1 3mo agoThanks! Any pro tips for sharding? I landed on single job because couldn't get cache to work properly for shards to be fast enough to worth it
- sunshowers 3mo agoI think in practice you're right that GitHub Actions' caching slowness can end up dominating performance. I don't have any great tips other than to measure.
- evntdrvn 3mo agoI've basically abandoned GA's caching for most things because measurements ended up showing things were slower with caching than without :woozy:
- jstrong 3mo agoseems like `cargo nextest run` just runs `--lib` tests by default? however, `cargo test` is not so slow if you do `cargo test --lib`. how do I get nextest to execute the doc tests, too?
- mattstir 3mo agoIt looks like doctests aren't supported: https://github.com/nextest-rs/nextest/issues/16 https://github.com/nextest-rs/nextest/issues/16
- sunshowers 3mo agoThe benchmarks are against non-doctest cargo test runs. (But you should measure against your own project, of course!) Unfortunately Cargo doesn't provide enough information for nextest to run doctests reliably with.
- jtwaleson 3mo agoSuper happy user here! It's an excellent piece of engineering. We're running a fork that supports a "sidecar" server for running multiple integration tests against. So if any tests that need the server are included, it spawns the server, runs the integration tests, and then shuts it down. By re-using the same server we speed up our runs tremendously. Discussion thread on gh: https://github.com/nextest-rs/nextest/discussions/3330 https://github.com/nextest-rs/nextest/discussions/3330
- mollerhoj 3mo agothe execution model of cargo-nextest makes my test suite extremely slow to run - Most of my tests rely on postgres. Since cargo-nextest uses a separate process per test, there is no efficient way to share the connection pool.