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 testthat::skip_if_offline() before most tests #77

Closed
2 tasks done
wibeasley opened this issue Jan 20, 2021 · 2 comments
Closed
2 tasks done

Add testthat::skip_if_offline() before most tests #77

wibeasley opened this issue Jan 20, 2021 · 2 comments
Assignees
Labels

Comments

@wibeasley
Copy link
Contributor

wibeasley commented Jan 20, 2021

There's a problem on the daily CRAN checks when run on Solaris. I need to

Below is the warning from the CRAN team. Here is a link to the live version of the checks, which updated daily: https://cran.r-project.org/web/checks/check_results_dataverse.html

One of the 24 failures.

  ── Error (tests-dataset_files.R:5:3): download tab from DOI and filename ───────
  Error: SSL certificate problem: certificate has expired
  Backtrace:
      █
   1. └─dataverse::get_dataverse("dataverse-client-r") tests-dataset_files.R:5:2
   2. ├─dataverse:::dataverse_id(...)
   3. └─dataverse:::dataverse_id.character(...)
   4. └─dataverse::get_dataverse(x, ..., check = FALSE)
   5. └─httr::GET(u, httr::add_headers(`X-Dataverse-key` = key), ...)
   6. └─httr:::request_perform(req, hu$handle$handle)
   7. ├─httr:::request_fetch(req$output, req$url, handle)
   8. └─httr:::request_fetch.write_memory(req$output, req$url, handle)
   9. └─curl::curl_fetch_memory(url, handle = handle)
  ── Error (tests-dataset_metadata.R:5:3): download tab from DOI and filename ────

Prof Brian Ripley
Tue 1/19/2021 10:22 AM
Dear maintainer,

Please see the problems shown on
https://cran.r-project.org/web/checks/check_results_dataverse.html.

Please correct before 2021-02-02 to safely retain your package on CRAN.

It seems we need to remind you of the CRAN policy:

'Packages which use Internet resources should fail gracefully with an informative message
if the resource is not available or has changed (and not give a check warning nor error).'

This needs correction whether or not the resource recovers.

The CRAN Team


Here are some useful resources I've read

  1. https://books.ropensci.org/http-testing/graceful.html#graceful
  2. https://books.ropensci.org/http-testing/cran-preparedness.html
  3. https://testthat.r-lib.org/reference/skip.html
  4. https://community.rstudio.com/t/internet-resources-should-fail-gracefully/49199
@wibeasley wibeasley self-assigned this Jan 20, 2021
wibeasley added a commit that referenced this issue Jan 20, 2021
wibeasley added a commit that referenced this issue Jan 20, 2021
@kuriwaki kuriwaki mentioned this issue Feb 19, 2021
@kuriwaki
Copy link
Member

Why would skip_if_offline() solve this Solaris error though?

Possibly relevant re certification: #83 (comment)

wibeasley added a commit that referenced this issue Feb 23, 2021
@wibeasley
Copy link
Contributor Author

@kuriwaki, my guess is 'yes', because if it can't reach the server (because of SSL or any other reason), the rest of the test is avoided. We'll find out I guess.

It's kinda cheating, but I see skip_on_os("solaris") is an option if we get desperate and can't debug it effectively.

https://github.com/r-lib/testthat/blob/master/R/skip.R#L117

https://testthat.r-lib.org/reference/skip.html

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

No branches or pull requests

2 participants