Skip to content
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

Add unit tests with shinytest #6

Open
carlganz opened this issue Sep 16, 2016 · 8 comments
Open

Add unit tests with shinytest #6

carlganz opened this issue Sep 16, 2016 · 8 comments

Comments

@carlganz
Copy link
Owner

https://github.com/MangoTheCat/shinytest

@carlganz
Copy link
Owner Author

carlganz commented Oct 7, 2016

I can't seem to get shinytest to work with travis. Any thoughts @gaborcsardi

@gaborcsardi
Copy link

Example failure?

@carlganz
Copy link
Owner Author

carlganz commented Oct 7, 2016

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?

@gaborcsardi
Copy link

I mean, can you please show me an actual Travis build that fails because of this problem?

@carlganz
Copy link
Owner Author

carlganz commented Oct 7, 2016

Oh of course, sorry:

https://travis-ci.org/carlganz/rintrojs/jobs/165728396

@gaborcsardi
Copy link

OK, can you try again? I think this fixed it:
rstudio/shinytest#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.

@carlganz
Copy link
Owner Author

carlganz commented Oct 8, 2016

Thanks! Unfortunately I am still getting the same error on Travis and Ubuntu.

https://travis-ci.org/carlganz/rintrojs/jobs/166065610

@gaborcsardi
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants