pacman
pacman copied to clipboard
Travis-CI Build Errors unsure why
I get no such buid errors locally: https://travis-ci.org/trinker/pacman
Running ‘testthat.R’
ERROR
Running the tests in ‘tests/testthat.R’ failed.
Last 13 lines of output:
24: getNamespace(ns)
25: tryCatch(loadNamespace(name), error = function(e) stop(e))
26: tryCatchList(expr, classes, parentenv, handlers)
27: tryCatchOne(expr, names, parentenv, handlers[[1L]])
28: value[[3L]](cond)
testthat results ================================================================
OK: 56 SKIPPED: 0 FAILED: 2
1. Error: p_install works
2. Error: p_install_version returns FALSE package doesn't exist on CRAN and min. not met
Error: testthat unit tests failed
Execution halted
* checking for unstated dependencies in vignettes ... OK
* checking package vignettes in ‘inst/doc’ ... WARNING
Package vignettes without corresponding PDF/HTML:
‘Introduction_to_pacman.Rmd’
‘pacman_functions_quick_reference.Rmd’
* checking running R code from vignettes ...
‘Introduction_to_pacman.Rmd’ ... OK
‘pacman_functions_quick_reference.Rmd’ ... OK
OK
* checking re-building of vignette outputs ... OK
* checking PDF version of manual ... OK
* DONE
Status: 1 ERROR, 1 WARNING
My guess is that we are expecting warnings in our tests but instead of using expect_warning we just try to suppress them but aren't doing it properly. and travis is using the warning -> error setting.
I can't modify anything on the repo at the moment but I think the following should fix one of the problems - change test-p_install.R to this:
context("Checking p_install")
test_that("p_install works",{
require(pacman)
expect_warning(tmp <- p_install("iDontExistAnywhere"))
expect_false(tmp)
})
and change the last test_that in test-p_install_version.R to
test_that("p_install_version returns FALSE package doesn't exist on CRAN and min. not met",{
expect_warning(out2 <- p_install_version("MadeUpPackage", "3.4.1"))
expect_false(out2[[1]])
})
In R CMD (Build/Check
in RStudio) this line:
tmp <- p_install("iDontExistAnywhere")
produces an error not a warning. If I do:
context("Checking p_install")
test_that("p_install works",{
require(pacman)
#expect_warning(tmp <- p_install("iDontExistAnywhere"))
expect_error(tmp <- p_install("iDontExistAnywhere"))
#expect_false(tmp)
})
All works. That means that the R CMD uses of testthat is somehow different than running devtools::test()
. I'm not sure what's going on. Again running devtools::test()
results in:
> devtools::test()
Testing pacman
Checking p_author : ..
Checking p_base : ..
Checking p_citation : .
Checking p_data : ..
no data sets found
...
Checking p_exists : ........
Checking p_extract : ....
Checking p_functions : ......
Checking p_install : Warning in install.packages :
package ‘iDontExistAnywhere’ is not available (for R Under development)
.
Checking p_install_gh :
which is expected. We pass the checks and devtools makes me feel good stating:
Way to go!
I suspect this is to mock me.
Dason said:
travis is using the warning -> error setting
I think this is pertinent. This is how the dev version of R seems to be handling the warnings as well.
I'll be honest - I've never really investigated the travis stuff as much as you have. Is this still an issue or should we close this?