Closed Ilia-Kosenkov closed 2 years ago
For the first point, might it be safer to always assume (edit: apparently, I forgot about non-package usages like path
is "."
and stop when the assumption is not true?rust_source()
... Please ignore, sorry)
This has been resolved in the past.
In light of #67 we need to modify the testing workflow. https://github.com/extendr/rextendr/blob/main/.github/workflows/test_pkg_gen.yaml We do not test two major features, which were a source of pain in #67:
use_extendr()
anddocument()
, assumingpath = "."
, and having package root as the work directory. Everything works naturally. However, as soon as this changes, path resolution can break. I believe we passpath
around correctly, but with future modifications, we need to track and verify this. The test script should, for example,setwd
to one of the parent directories of the package root and then invokeuse_extendr
anddocument
with explicit relative paths. Successful compilation ensures all paths are resolved correctly.document()
test package and then run R CMD check to verify if the package is compiled and documented correctly. https://github.com/extendr/rextendr/blob/74817048d578c640e77df740e1fa00071320a011/.github/workflows/test_pkg_gen.yaml#L119-L125 What we do not test is re-compilation when Rust code gets modified. We need to be able to modifylib.rs
, adding another {roxygen2} tag (e.g.@returns
), and changing the returned value to a different string, then runningdocument()
and testing if everything has been updated in one go. This includeshello_world.Rd
having new entry and a differrent return value oftestpkg::hello_world()
.I doubt this can be achieved using R CMD check, perhaps we should perform all checks manually and throw errors if something goes wrong (e.g., with
stop
).Rscript
interrupted withstop
should return a non-zero exit code, which should fail the test job.