Skip to content
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

Doesn't specify which tests run in parallel and which tests run in fresh environment #3042

Closed
2 tasks done
safinaskar opened this issue Feb 4, 2022 · 1 comment
Closed
2 tasks done

Comments

@safinaskar
Copy link

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
@carols10cents
Copy link
Member

This is more appropriate for the Cargo book; please re-file this over in https://github.com/rust-lang/cargo. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants