Comments (3)
I guess that use one process per test makes useless #[once]
attribute. I think that there are scenario where instantiate some resource shared across tests (like docker instances or populate db) only once is really useful... in this case the model one process one test don't works very well.
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.
from nextest.
Thanks for the report and the debugging! Yes, one process per test is incompatible with that kind of initialization. The options are:
- Initialize separate, isolated universes for each test, which can work with files on disk and some database situations, but is definitely harder to do with Docker by my understanding.
- Combine all the individual tests into a single
#[test]
so that it's all run together.
#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.
from nextest.
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 #[once]
-like features are mostly useful for sharing resources between tests, either because setting up the resource is expensive, or because the tests are somehow coupled by the resource.
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 rstest
's case
s, where different data are injected into the same test).
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!
from nextest.
Related Issues (20)
- Archive extra files, relative to paths other than the target directory
- Add a way to include extra files on a per-test-binary and per-platform basis
- Add a "testimonials" page (please comment here!) HOT 3
- v0.9.70 using significantly more stack HOT 7
- [windows] lots of tests running in parallel may cause "leaky" warnings HOT 3
- Idea: network isolation between tests HOT 14
- Add support for `cargo test`s --skip and --exact command line flags HOT 2
- `cargo nextest run --workspace` fails with DLL missing if a macro lib exists HOT 14
- nextest chooses arbitrarily not to run some tests it's found HOT 7
- Consider conditions to not include libstd in archives
- [meta] tell users what configuration their tests are running with
- Human-readable configuration output HOT 1
- Machine-readable configuration output
- Feature Request: Conditional skipping test based on setup scripts HOT 1
- Test Suite Running Very Slowly HOT 2
- Feature Request: Filter tests in a certain group HOT 1
- I encountered a bug, installation error HOT 5
- `nextest run` crashes in guppy... in some environments? HOT 3
- Feature request: Shell completions
- Behavior change: produce a non-zero exit code (4) if no tests were run HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nextest.