-
Notifications
You must be signed in to change notification settings - Fork 321
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
Dis-/ Enable parallel testing locally #1570
Comments
I think the only way to achieve this is to have two test suites, and turn on/off parallel testing when they are started, via the env var (see docs). When using them outside of testthat::test_dir("tests/othertests") |
@gaborcsardi Thanks for the hint! Could you specify where to find the "env var switch"-Section within the docs? So far I only read about adding some lines to the |
Apologies if it is not the docs, you need to set the |
Exactly what I was looking for 😀 - thanks a lot! The docs seems to be missing this detail though. Here´s a short example for posterity using Sys.setenv("TESTTHAT_PARALLEL" = "FALSE")
devtools::test() # run all unit-tests within /testthat (in current process)
Sys.setenv("TESTTHAT_PARALLEL" = "TRUE")
testthis::test_integration() # run all integration-tests within /testthat/integration_tests (in parallel)
Sys.setenv("TESTTHAT_PARALLEL" = "") # clean up Note that |
I divided my tests into several subcategories as
Unit
,Integration
, ...testthis
is a great package leaveragingtestthat
to run every category by its own.I would like to achieve the following behaviour:
As of now I only aware of enabling parallel testing within the
DESCRIPTION
file globaly. Is there a possible way to achieve this distinction?The text was updated successfully, but these errors were encountered: