rintrojs
rintrojs copied to clipboard
Add unit tests with shinytest
https://github.com/MangoTheCat/shinytest
I can't seem to get shinytest to work with travis. Any thoughts @gaborcsardi
Example failure?
When I ran R CMD CHECK on my Mac with the shinytests it worked fine. On my Ubuntu, devtools::test()
works fine, but when I run R CMD CHECK I get
Error in library(shinytest) : there is no package called 'shinytest'
Which is the error I get on travis for Linux and Mac. Am I missing something?
I mean, can you please show me an actual Travis build that fails because of this problem?
Oh of course, sorry:
https://travis-ci.org/carlganz/rintrojs/jobs/165728396
OK, can you try again? I think this fixed it: https://github.com/MangoTheCat/shinytest/pull/52
In brief, shinytest starts another R process to run the app, and this process could not load your package, because it was not installed on the system. (And on Travis, the new R process also did not have the right library paths, anyway.)
Now we make sure that we set the same library path, as in the R process that runs the check and the tests.
I you test locally with devtools::test()
, then you still need to devtools::install
the package, so that shinytest loads the most recent version. We'll work around this at some point.
Btw. also note that the shinytest API will probably change significantly in the future.
Thanks! Unfortunately I am still getting the same error on Travis and Ubuntu.
https://travis-ci.org/carlganz/rintrojs/jobs/166065610
Yes, that's a different error, sorry.
I am not what is wrong, because according to the logs, shinytest is clearly installed. Maybe a caching problem? Can you try clearing the Travis cache?