-
Notifications
You must be signed in to change notification settings - Fork 317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests run in R session, but "R CMD check" fails #86
Comments
Hmmm, calls to |
I'm seeing similar issues, though I'm not calling I'll dig deeper into the issue, but figured I'd share the strange behavior while I work through this. |
I'm finding the same issue, using R 3.2.2 on OSX Mavericks. Per the instructions in the README.md, I put the following into
Upon running
However, all things being equal, testing in the R console works fine:
|
PS: |
Found a workaroundThis issue is related to these others: #144 and zoonproject/zoon#150. A workaround is here: luckyrandom/cmaker@b85813a Simply add |
This code keeps popping up in R. |
…actively but would fail when switching to devtools::check(); workaround found in r-lib/testthat#86 (comment)
I see this error too in what I think is a more recent version of * checking tests ...
Running ‘testthat.R’^C
ERROR
Running the tests in ‘tests/testthat.R’ failed.
Last 13 lines of output:
>
> test_check("phylogenetic")
Error in file(filename, "r", encoding = encoding) :
cannot open the connection
Calls: local ... eval.parent -> eval -> eval -> eval -> eval -> source -> file
In addition: Warning message:
In file(filename, "r", encoding = encoding) :
cannot open file 'startup.Rs': No such file or directory
Execution halted
testthat results ================================================================
OK: 6 SKIPPED: 0 FAILED: 0
Execution halted
R version 3.3.2 (2016-10-31)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] testthat_1.0.2 phylogenetic_0.1.99
loaded via a namespace (and not attached):
[1] magrittr_1.5 R6_2.2.0 Matrix_1.2-8 parallel_3.3.2 tools_3.3.2 coda_0.19-1
[7] crayon_1.3.2 Rcpp_0.12.9 ABCoptim_0.14.0 nlme_3.1-128 ape_4.0 grid_3.3.2
[13] numDeriv_2016.8-1 lattice_0.20-34 |
I am getting that same "RStudio not running" error even with Tests run fine with
|
I am also getting same error despite trying the
Any advice? |
…t and R CMD CHECK see - r-lib/testthat#86
@jsilve24 Please open a new issue and if possible include the package you are seeing this error as a link, it won't be possible to debug this without seeing the package. |
In my particular case, the discrepancy I got between BeforeIn units::install_conversion_constant("FL", "ft", 100)
fl_to_foot <- function(fl) {
fl %>%
units::set_units(FL) %>%
units::set_units(ft) %>%
units::drop_units()
} in context("Units convertion")
library(trfcplx)
test_that("fl_to_foot converts flight levels (FL) to feet", {
expect_equal(fl_to_foot(150), 15000)
})
AfterIn fl_to_foot <- function(fl) {
fl %>%
units::set_units(FL) %>%
units::set_units(ft) %>%
units::drop_units()
} In # register flight levels (FL) as a unit when loading this package
.onLoad <- function(libname, pkgname) {
# install user-define unit for flight level
units::install_conversion_constant("FL", "ft", 100)
invisible()
}
# register flight levels (FL) as a unit when loading this package
.onUnload <- function(libname, pkgname) {
# uninstall user-define unit for flight level
units::remove_symbolic_unit("FL")
invisible()
}
|
I had the same issue and solved it with a different approach.
My code was creating child processes with I fixed it by instead calling |
tests for a package (see below) fail when run by "R CMD check", but if i run them from an R session, everything is fine. the package tested creates some files in a tempdir and i want to check for their existance.
i've noticed errors like
"Error in file(filename, "r", encoding = encoding) : cannot open the connection
Calls: local ... eval.parent -> eval -> eval -> eval -> eval -> source -> file
In addition: Warning message:
In file(filename, "r", encoding = encoding): cannot open file 'startup.Rs': No such file or directory"
my package functions use some setwd() calls. when i create a dummy "startup.Rs" file in the directory the functions jump to, these errors disappear. i have no clue what this file is supposed to do or why it's only missing when "R CMD check" is running the tests. anyway, the tests still fail after all.
in addition, testthat didn't load all dependencies, i had do manually add a require() call to the test suite. here's the package, if you want to try to replicate the problem: http://reaktanz.de/stuff/R/roxyPackage_0.03-11.tar.gz
The text was updated successfully, but these errors were encountered: