You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Doesn't specify which tests run in parallel and which tests run in fresh environment #3042
Hi. I aware of 3 types of tests in Rust: unit tests, integration tests and doctests. I would like to see in Rust book, in documentation for cargo test in Cargo book and in Rustdoc book the following info: whether this tests run in parallel and whether every test is run in fresh environment, i. e. in new process created specially for this test. Please note that "sequential execution" and "execution of each test in fresh environment" are different things. Consider unit tests run using cargo test -- --test-threads=1. As well as I understand they will be run sequentially, but they still be run in the same process, thus chdir and similar operations from one test will affect others. I want to see in book and other docs answers to this questions:
Do unit tests run in parallel?
Does every unit test run in fresh environment?
Do integration tests (different #[test] functions from same file in tests) run in parallel?
Does every integration test (different #[test] functions from same file in tests) run in fresh environment?
Do integration tests from different files in tests run in parallel?
Does every integration test (from different files in tests) run in fresh environment?
Do doctests run in parallel?
Does every doctest run in fresh environment?
Currently I was able to easily find answers to first two questions. But rust book and other docs are vague on others. ch11-03-test-organization doesn't answer questions on integration tests. Section https://doc.rust-lang.org/rustdoc/documentation-tests.html doesn't answer questions on doctests
I have checked the latest main branch to see if this has already been fixed
I have searched existing issues and pull requests for duplicates
Activity
carols10cents commentedon Feb 4, 2022
This is more appropriate for the Cargo book; please re-file this over in https://github.com/rust-lang/cargo. Thanks!