Closed Ilia-Kosenkov closed 3 years ago
We currently skip all tests when cargo
is not available:
https://github.com/extendr/rextendr/blob/fa8dd4bf49af4e6afa9845e2f112451faf901f23/tests/testthat.R#L5-L8
This check should be extended to skip all tests on CRAN. I don't think there are going to be any tests that meaningfully can be executed on CRAN.
The check should use something like this code from testthat: https://github.com/r-lib/testthat/blob/149c888b8163c7070d66d691c2ef6d7b3eed8745/R/skip.R#L131
It's probably a good idea to merge #7 before addressing this issue.
Can we close this issue?
Yes, I think so. I'll mention that maybe we need to rethink the idea of skipping all tests on CRAN. We're starting to add many unit tests that aren't Rust-dependent and that could run on CRAN.
As was discussed in #15, without proper tests it is impossible to catch errors like the one fixed in #16. However, tests cannot be
rust
-dependent or otherwise compromiseCRAN
builds. So tests can be either skipped onCRAN
(or using other condition), or they can be implemented outside of the normal test framework and executed manually on CI.I suggest to have
skip_on_cran
tests that can be executed when package is installed by the client -- to immediately reveal if client's system is misconfigured.