yihui / xfun

Miscellaneous R functions
https://yihui.org/xfun/
Other
135 stars 28 forks source link

add a few tests #56

Closed etiennebacher closed 2 years ago

etiennebacher commented 3 years ago

I hope this helps, #5

CLAassistant commented 3 years ago

CLA assistant check
All committers have signed the CLA.

etiennebacher commented 3 years ago

Thanks a lot for the feedback, indeed I don't have much experience writing tests. I separated the tests for CRAN and travis and removed some of them

yihui commented 3 years ago

That's much better now.

Do you know how to fix the check errors on Github Actions? e.g. https://github.com/yihui/xfun/pull/56/checks?check_run_id=3488914493 (I'm just asking in case you want to gain more experience; I know how to fix them)

etiennebacher commented 3 years ago

thanks for asking, I'll look at it a bit tomorrow, it's the night here ;)

etiennebacher commented 3 years ago

okay I give up, you can fix it

cderv commented 3 years ago

@etiennebacher A few hint:

Error from available.packages() Error in contrib.url(repos, type) : trying to use CRAN without setting a mirror

This means somewhere the CRAN mirror is needed but unset (Options repos is not set) You may need to pass it in a function or set the option. On interactive R session, you would be asked for a CRAN mirror. Inside RSTUDIO IDE, you don't have the issue because the IDE sets one by default for you.

I think it could be in this test https://github.com/yihui/xfun/pull/56/files#diff-753ce45f57bf1e464964d20def167f7db377a87465e551a021296241ed27fd1aR4

I let you dig into that 😉

etiennebacher commented 3 years ago

Thanks for the hint @cderv, R cmd check succeeds now. But I'm wondering whether options(repos = c(CRAN = "https://cran.rstudio.com")) should be put in test-travis.R instead, so that it is only needed to call it once, even if multiple tests require this repo option.

cderv commented 3 years ago

Yes I agree. It could probably even be configured at the travis level also I believe... 🤔

etiennebacher commented 3 years ago

Seems to work with repo options in test-travis.R