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
Incompatibility with rstest's once #209
Comments
I guess that use one process per test makes useless Is a chance introduce an option to run tests in the same executable with multiple thread that can share resources? I know why you adopt this model and all benefits that this model have, but this kinds of scenario are really common in integration tests. |
Thanks for the report and the debugging! Yes, one process per test is incompatible with that kind of initialization. The options are:
#27 tracks adding the option to add a mode where all tests are run within the same process. It is quite nontrivial, however -- one of the challenges is that individual test data isn't exposed by stable Rust. Regardless, I would be happy to welcome a pull request that does something reasonable in that case. I think I'm going to close this as a duplicate of #27, since solving that should address this. |
Separate, isolated universes for each test, would indeed be useful for avoiding collisions (and in the case of files colliding, this can and should be addressed with some unique filename-generation utility), but Combining tests into an individual test would be a possibility in the latter cases, but then you lose the benefits of fine granularity of failure reporting that comes with small, separate tests. Especially annoying would be the loss of parametrized tests (such as But these are second-order details. I appreciate that it's difficult, and that solving #27 should address this, so I agree with closing. Thanks again for the excellent crate! |
Thank you very much for this project, it really makes the testing experience in Rust much more fun and productive.
I've come across what I suspect to be an incompatibility between
nextest
and another crate that helps with testing in Rust:rstest
, specifically itsonce
fixture attribute, whose purpose is to ensure that a fixture is executed only once per test run.I use
rstest
's fixture in some tests, and wanted to write the data created by the fixture to a file, to be able to inspect them manually after the tests run. When usingcargo nextest
the fixture (which is marked with#[once]
and hence should only run once in the whole test run) fails because it tries to write to the file multiple times simultaneously. Executing the same test suite with plaincargo test
does not suffer from this problem. So it looks likenextest
execution model is working around therstest #[once]
mechanism for ensuring single execution.Is there any chance that these two excellent projects might be made usable together, in this particular instance?
I've opened a similar issue in
rstest
.The text was updated successfully, but these errors were encountered: