ropensci / ruODK

ruODK: An R Client for the ODK Central API
https://docs.ropensci.org/ruODK/
GNU General Public License v3.0
42 stars 13 forks source link

Use VCR in tests #104

Closed florianm closed 3 years ago

florianm commented 3 years ago

Feature

To prepare a possible CRAN submission, use https://github.com/ropensci/vcr to record server responses. Skip tests that download files, include cached server responses.

florianm commented 3 years ago

Done with exception of tests downloading files. Tests performance goes from 60 sec uncached to 50 sec cached.

It looks like even the vcr enabled tests won't work on CRAN, as they all depend on API settings and credentials: https://books.ropensci.org/http-testing/vcr-intro.html#vcr-enabled-tests-on-cran

Would be nice to have file downloads cached as they take the longest. CRAN would need to skip_on_cran() all tests talking to the ODK Central API, which - unsurprisingly for an API wrapper package - covers the majority of functions.