Closed Ilia-Kosenkov closed 1 year ago
This is caused by https://github.com/extendr/rextendr/blob/fc3c70d01fd987487b8f3c94f758828c68ddc916/tests/testthat/setup.R#L5
@yutannihilation , you added this (if I read the history correctly), can you explain why we need this in tests?
I don't remember, but this seems the context:
R CMD check
fails with the default configuration when a temporary directory is used for testing.Can be observed when executing
devtools::check()
orrcmdcheck::rcmdcheck()
(withcheck_dir
left unset or painting to a place outside of the package folder).devtools::check()
``` ══ Documenting ═════════════════════════════════════════════════════════════════ ℹ Updating rextendr documentation ℹ Loading rextendr ══ Building ════════════════════════════════════════════════════════════════════ Setting env vars: • CFLAGS : -Wall -pedantic • CXXFLAGS : -Wall -pedantic • CXX11FLAGS: -Wall -pedantic • CXX14FLAGS: -Wall -pedantic • CXX17FLAGS: -Wall -pedantic • CXX20FLAGS: -Wall -pedantic ── R CMD build ───────────────────────────────────────────────────────────────── * checking for file 'E:\OneDrive\Development\OSS\rextendr/DESCRIPTION' ... OK * preparing 'rextendr': * checking DESCRIPTION meta-information ... OK * installing the package to build vignettes * creating vignettes ... OK * checking for LF line-endings in source and make files and shell scripts * checking for empty or unneeded directories * building 'rextendr_0.2.0.9000.tar.gz' ══ Checking ════════════════════════════════════════════════════════════════════ Setting env vars: • _R_CHECK_CRAN_INCOMING_REMOTE_ : FALSE • _R_CHECK_CRAN_INCOMING_ : FALSE • _R_CHECK_FORCE_SUGGESTS_ : FALSE • _R_CHECK_PACKAGES_USED_IGNORE_UNUSED_IMPORTS_: FALSE • NOT_CRAN : true ── R CMD check ───────────────────────────────────────────────────────────────── * using log directory 'C:/Users/Run `rustc --explain CODE` -v, --verbose... Use verbose output (-vv very verbose/build.rs output) -q, --quiet Do not print cargo log messages --color Coloring: auto, always, never
-C Change to DIRECTORY before doing anything
--frozen Require Cargo.lock and cache are up to date
--locked Require Cargo.lock is up to date
--offline Run without accessing the network
--config Override a configuration value
-Z Unstable (nightly-only) flags to Cargo, see 'cargo -Z help' for details
-h, --help Print help
Some common cargo commands are (see all commands with --list):
build, b Compile the current package
check, c Analyze the current package and report errors, but don't build object files
clean Remove the target directory
doc, d Build this package's and its dependencies' documentation
new Create a new cargo package
init Create a new cargo package in an existing directory
add Add dependencies to a manifest file
remove Remove dependencies from a manifest file
run, r Run a binary or example of the local package
test, t Run the tests
bench Run the benchmarks
update Update dependencies listed in Cargo.lock
search Search registry for crates
publish Package and upload this package to the registry
install Install a Rust binary. Default location is $HOME/.cargo/bin
uninstall Uninstall a Rust binary
See 'cargo help ' for more information on a specific command.
> not_cran <- identical(Sys.getenv("NOT_CRAN"), "true")
>
> if (cargo_available && not_cran) {
+ test_check("rextendr")
+ }
Starting 8 test processes
Error in `private$handle_error()`:
! testthat subprocess failed to start, stderr:
Error: No root directory found in C:/Users//AppData/Local/Temp/RtmpcR3mjO/file9f872c131b3/rextendr.Rcheck/tests/testthat or its parent directories. Root criterion: contains a file "DESCRIPTION"
In addition: Warning message:
package 'testthat' was built under R version 4.2.3
Caused by error:
! R session crashed with exit code 1
Backtrace:
▆
1. └─testthat::test_check("rextendr")
2. └─testthat::test_dir(...)
3. └─testthat:::test_files(...)
4. └─testthat:::test_files_parallel(...)
5. ├─testthat::with_reporter(...)
6. │ └─base::tryCatch(...)
7. │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
8. │ └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
9. │ └─base (local) doTryCatch(return(expr), name, parentenv, handler)
10. └─testthat:::parallel_event_loop_chunky(queue, reporters)
11. └─queue$poll(Inf)
12. └─base::lapply(...)
13. └─testthat (local) FUN(X[[i]], ...)
14. └─private$handle_error(msg, i)
15. └─rlang::abort(...)
Execution halted
1 error ✖ | 0 warnings ✔ | 3 notes ✖
Error: R CMD check found ERRORs
Execution halted
```