I'm testing this R package.
The following three things work just fine:
devtools::test()
devtools::test_file("tests/testthat.R")
- Travis-CI with release version of R
However, the following things
devtools::check()
devtools::build_win()
# (see win-builder output here)
produce this error:
R CMD check results 1 error | 0 warnings | 0 notes checking tests ... ERROR Running ‘testthat.R’ Running the tests in ‘tests/testthat.R’ failed. Last 13 lines of output: 40: mutate_.data.frame(., city_pop = ~readr::parse_number(Population..4), metro_pop = ~readr::parse_number(Population..5), urban_pop = ~readr::parse_number(Population..6), Country = ~gsub(",", "_", Country)) 41: mutate(.data, !(!(!dots))) 42: mutate.data.frame(.data, !(!(!dots))) 43: as.data.frame(mutate(tbl_df(.data), ...)) 44: mutate(tbl_df(.data), ...) 45: mutate.tbl_df(tbl_df(.data), ...) 46: mutate_impl(.data, dots) testthat results ================================================================ OK: 34 SKIPPED: 0 FAILED: 1 1. Error: cities works (@test-etl.R#113) Error: testthat unit tests failed Execution halted
Additionally, the old release Travis-CI job throws an error about dplyr
and readr
being missing, and the development release Travis-CI job throws an error about not being able to connect to the database. (I sort of suspect that these errors are unrelated to the above.)
I've read this and this and this and this but none of these seem to be my problem.
I've tried all of my usual tricks and I'm fairly confident that there is not actually a bug in the code, there is just some kind of environment/NAMESPACE
mismatch that I don't understand and don't know how to debug.
Any ideas? I'm on Ubuntu
using R 3.4.1
.
MWE
# shell
git clone git@github.com:beanumber/etl.git
# R
library(devtools)
test()
check()