-
Notifications
You must be signed in to change notification settings - Fork 351
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
[RFC] Adopt cargo nextest
#2131
Comments
It seems that |
Hmmm... Good catch. We do have the option to add an extra step with |
Another benefit of using |
Does it have any impact on our test coverage? I'd also like to shorten the CI time so I'd rather introduce it if we can clear everything. |
Coverage is supported: https://nexte.st/book/test-coverage.html I believe only the doc test requires a bit extra workaround which to me should be acceptable. If the general direction is OK, then I will put together a PR for review. |
Let's go ahead 🚀 |
@YJDoc2 |
Hey, I had taken look at nextest a while back, and it seems pretty good. It supports most of the cargo test features, and is pretty fast as well. I think we should go ahead with the split approach of using nextest for unitests, and then running doctests via I also have a suggestion, although not sure if it would be possible : Can we have a default fallback in justfile itself? So when we run @yihuaf some of our tests need to be run in strictly serial mode, so please check that they are getting correctly run, apart from that I think we should go ahead! On a separate note, I'm also thinking of contributing to nextest to detect all kinds of leaked process, and if that goes well ; then we'd be able to detect and prevent a lot of leakage via unit tests themselves. |
So far I have not seen any issue. |
Well, I wouldn't maybe just put nextest as a drop-in replacement. The reason is that sometimes when testing you have a computationally expensive setup procedure. If you are using threads, you can just run it once and define it, using for example I think the idea of nextest is good in that they don't run one test file per binary sequencially, and then maybe one of the test is slower and then delays everything. However, I think maybe it should just merge the files into a single binary, or allow us to choose. |
cargo nextest
is a improved version of test runners compared to the defaultcargo test
and it is a drop in replacement. The home page summarizes the benefit well: https://nexte.st/index.html#features. There is not clear down side I can think of.Specifically, I like the speed and the leaky test detection. The speed is noticeably faster. This can reduce the test to under 2 seconds running all unit tests. The leaky test detection is useful because we launch processes and threads in our unit tests. This allows us to detect processes that are not correctly terminated in the test, which almost always indicates a bug in our code. For example, this PR (#1948) was the result of me playing with
cargo nextest
a while back and noticed that one of the test related to foreground mode is leaky.The text was updated successfully, but these errors were encountered: