I have a bunch of tests that I don't want them running during CRAN checks or Travis CI builds. They are either long-running, or they could cause transaction/concurrency conflicts writing to a networked database. What approach of separating them (from the R CMD check tests) works best with testthat?
Should I put those tests in a separate folder? Should I tag their filename and use a regex? (eg Using filter argument in test_package to skip tests by @Jeroen)
http://cran.r-project.org/web/packages/policies.html:
Long-running tests and vignette code can be made optional for checking, but do ensure that the checks that are left do exercise all the features of the package.
If you're using RStudio, press Cmd/Ctrl + Shift + T (or run devtools::test() if not) to run all the tests in a package.
'testthat' is a testing framework for R that is easy to learn and use, and integrates with your existing 'workflow'. License MIT + file LICENSE. URL https://testthat.r-lib.org, https://github.com/r-lib/testthat.
If you put them in another directory within tests
, then you can still test them manually with test_dir()
, but they won't be running with test()
or R CMD check
.
E.g. R6 has some manual tests: https://github.com/wch/R6/tree/master/tests
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With