extendr / rextendr

An R package that helps scaffolding extendr-enabled packages or compiling Rust code dynamically
https://extendr.github.io/rextendr/
Other
184 stars 27 forks source link

Integration tests #17

Closed Ilia-Kosenkov closed 3 years ago

Ilia-Kosenkov commented 3 years ago

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 compromise CRAN builds. So tests can be either skipped on CRAN (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.

clauswilke commented 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

clauswilke commented 3 years ago

It's probably a good idea to merge #7 before addressing this issue.

yutannihilation commented 3 years ago

Can we close this issue?

clauswilke commented 3 years ago

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.