Running ‘testthat.R’ [16s/135s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library("testthat")
  > library("rnrfa")
  > # library("lintr")
  > 
  > api_unavailable <- function(){
  +   resp1 <- httr::GET(url = "https://nrfaapps.ceh.ac.uk/nrfa/ws/time-series", 
  +                      query = list(format = "json-object", station = 39001,`data-type` = "gdf"), 
  +                      httr::user_agent("https://github.com/ilapros/rnrfa"))
  +   resp2 <- httr::GET(url = "https://nrfaapps.ceh.ac.uk/nrfa/ws/time-series", 
  +                      query = list(format = "json-object", station = 39001,`data-type` = "cmr"), 
  +                      httr::user_agent("https://github.com/ilapros/rnrfa"))
  +   # if any of the two streams is not working skip tests 
  +   (httr::http_error(resp1) | httr::http_error(resp2))
  + }
  > 
  > # skip_if_no_api() <- function() {
  > #   if (api_unavailable()) {
  > #     skip("API not available")
  > #   }
  > # }
  > 
  > if (!curl::has_internet()) {
  +   message("No internet, cannot run tests")
  + }else {
  +   test_check("rnrfa")
  + }
  Saving _problems/test-catalogue-17.R
  [ FAIL 1 | WARN 0 | SKIP 0 | PASS 66 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-catalogue.R:17:3'): Output of catalogue function is expected to be at least 1539x20 ──
  <curl_error_operation_timedout/curl_error/error/condition>
  Error in `curl::curl_fetch_memory(url, handle = handle)`: Timeout was reached [nrfaapps.ceh.ac.uk]:
  Connection timed out after 10001 milliseconds
  Backtrace:
      ▆
   1. ├─testthat::skip_if(api_unavailable(), "API not available") at test-catalogue.R:17:3
   2. │ └─base::isTRUE(condition)
   3. ├─rnrfa (local) api_unavailable()
   4. │ └─httr::GET(...) at test-catalogue.R:4:3
   5. │   └─httr:::request_perform(req, hu$handle$handle)
   6. │     ├─httr:::request_fetch(req$output, req$url, handle)
   7. │     └─httr:::request_fetch.write_memory(req$output, req$url, handle)
   8. │       └─curl::curl_fetch_memory(url, handle = handle)
   9. └─curl:::raise_libcurl_error(...)
  
  [ FAIL 1 | WARN 0 | SKIP 0 | PASS 66 ]
  Error:
  ! Test failures.
  Execution halted