Running ‘testthat.R’ [0m/35m]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(StreamCatTools)
  > 
  > test_check("StreamCatTools")
  [ FAIL 10 | WARN 7 | SKIP 0 | PASS 50 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test-lc_get_params.R:10:3'): sc_get_params for variable_info parameters ──
  <httr2_http_504/httr2_http/httr2_error/rlang_error/rlang_error/error/condition>
  Error in `httr2::req_perform(httr2::request("https://api.epa.gov/StreamCat/streams/variable_info"))`: HTTP 504 Gateway Timeout.
  Backtrace:
       ▆
    1. └─StreamCatTools::sc_get_params(param = "variable_info") at test-lc_get_params.R:10:3
    2.   ├─dplyr::rename(...)
    3.   ├─dplyr::select(...)
    4.   ├─readr::read_csv(...)
    5.   │ └─vroom::vroom(...)
    6.   │   └─vroom:::standardise_path(file)
    7.   ├─httr2::resp_body_string(httr2::req_perform(httr2::request("https://api.epa.gov/StreamCat/streams/variable_info")))
    8.   │ └─httr2:::check_response(resp)
    9.   │   └─httr2:::is_response(resp)
   10.   └─httr2::req_perform(httr2::request("https://api.epa.gov/StreamCat/streams/variable_info"))
   11.     └─httr2:::handle_resp(req, resp, error_call = error_call)
   12.       └─httr2:::resp_failure_cnd(req, resp, error_call = error_call)
   13.         ├─rlang::catch_cnd(...)
   14.         │ ├─rlang::eval_bare(...)
   15.         │ ├─base::tryCatch(...)
   16.         │ │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
   17.         │ │   └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
   18.         │ │     └─base (local) doTryCatch(return(expr), name, parentenv, handler)
   19.         │ └─base::force(expr)
   20.         └─rlang::abort(...)
  ── Error ('test-lc_get_params.R:16:3'): lc_get_params for area of interest parameters ──
  Error in `open.connection(con, "rb")`: cannot open the connection to 'https://api.epa.gov/StreamCat/lakes/metrics'
  Backtrace:
      ▆
   1. └─StreamCatTools::lc_get_params(param = "areaOfInterest") at test-lc_get_params.R:16:3
   2.   └─jsonlite::fromJSON("https://api.epa.gov/StreamCat/lakes/metrics")
   3.     └─jsonlite:::parse_and_simplify(...)
   4.       └─jsonlite:::parseJSON(txt, bigint_as_char)
   5.         └─jsonlite:::parse_con(txt, bigint_as_char)
   6.           ├─base::open(con, "rb")
   7.           └─base::open.connection(con, "rb")
  ── Error ('test-lc_get_params.R:22:3'): lc_get_params for region parameters ────
  Error in `open.connection(con, "rb")`: cannot open the connection to 'https://api.epa.gov/StreamCat/streams/metrics'
  Backtrace:
      ▆
   1. └─StreamCatTools::sc_get_params(param = "region") at test-lc_get_params.R:22:3
   2.   └─jsonlite::fromJSON("https://api.epa.gov/StreamCat/streams/metrics")
   3.     └─jsonlite:::parse_and_simplify(...)
   4.       └─jsonlite:::parseJSON(txt, bigint_as_char)
   5.         └─jsonlite:::parse_con(txt, bigint_as_char)
   6.           ├─base::open(con, "rb")
   7.           └─base::open.connection(con, "rb")
  ── Error ('test-lc_getdata.R:22:3'): lc_get_data for a hydroregion and ws metrics returns a data frame ──
  Error in `open.connection(con, "rb")`: cannot open the connection to 'https://api.epa.gov/StreamCat/streams/metrics'
  Backtrace:
      ▆
   1. └─StreamCatTools::lc_get_data(...) at test-lc_getdata.R:22:3
   2.   └─StreamCatTools::sc_get_params(param = "metric_names")
   3.     └─jsonlite::fromJSON("https://api.epa.gov/StreamCat/streams/metrics")
   4.       └─jsonlite:::parse_and_simplify(...)
   5.         └─jsonlite:::parseJSON(txt, bigint_as_char)
   6.           └─jsonlite:::parse_con(txt, bigint_as_char)
   7.             ├─base::open(con, "rb")
   8.             └─base::open.connection(con, "rb")
  ── Error ('test-lc_nlcd.R:5:13'): lc_get_data for a sample COMID returns a data frame ──
  <httr2_http_502/httr2_http/httr2_error/rlang_error/rlang_error/error/condition>
  Error in `httr2::req_perform(httr2::req_retry(httr2::req_throttle(httr2::req_body_form(httr2::req_method(httr2::req_headers(httr2::req_method(req, 
      "POST"), `Content-Type` = "application/x-www-form-urlencoded"), 
      "POST"), !!!header_data), rate = 30/60), backoff = ~5, max_tries = 3))`: HTTP 502 Bad Gateway.
  Backtrace:
       ▆
    1. └─StreamCatTools::lc_nlcd(year = "2019", aoi = "catchment", comid = "23783629,23794487,23812618") at test-lc_nlcd.R:5:13
    2.   └─StreamCatTools::lc_get_data(...)
    3.     ├─jsonlite::fromJSON(...)
    4.     ├─httr2::resp_body_string(...)
    5.     │ └─httr2:::check_response(resp)
    6.     │   └─httr2:::is_response(resp)
    7.     └─httr2::req_perform(...)
    8.       └─httr2:::handle_resp(req, resp, error_call = error_call)
    9.         └─httr2:::resp_failure_cnd(req, resp, error_call = error_call)
   10.           ├─rlang::catch_cnd(...)
   11.           │ ├─rlang::eval_bare(...)
   12.           │ ├─base::tryCatch(...)
   13.           │ │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
   14.           │ │   └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
   15.           │ │     └─base (local) doTryCatch(return(expr), name, parentenv, handler)
   16.           │ └─base::force(expr)
   17.           └─rlang::abort(...)
  ── Error ('test-lc_nlcd.R:13:3'): lc_get_data for a county and ws metrics returns a data frame ──
  Error in `open.connection(con, "rb")`: cannot open the connection to 'https://api.epa.gov/StreamCat/streams/metrics'
  Backtrace:
      ▆
   1. └─StreamCatTools::lc_nlcd(...) at test-lc_nlcd.R:13:3
   2.   └─StreamCatTools::lc_get_data(...)
   3.     └─StreamCatTools::sc_get_params(param = "metric_names")
   4.       └─jsonlite::fromJSON("https://api.epa.gov/StreamCat/streams/metrics")
   5.         └─jsonlite:::parse_and_simplify(...)
   6.           └─jsonlite:::parseJSON(txt, bigint_as_char)
   7.             └─jsonlite:::parse_con(txt, bigint_as_char)
   8.               ├─base::open(con, "rb")
   9.               └─base::open.connection(con, "rb")
  ── Error ('test-sc_get_params.R:26:3'): sc_get_params for variable_info parameters ──
  Error in `open.connection(con, "rb")`: cannot open the connection to 'https://api.epa.gov/StreamCat/streams/metrics'
  Backtrace:
      ▆
   1. └─StreamCatTools::sc_get_params(param = "variable_info") at test-sc_get_params.R:26:3
   2.   └─jsonlite::fromJSON("https://api.epa.gov/StreamCat/streams/metrics")
   3.     └─jsonlite:::parse_and_simplify(...)
   4.       └─jsonlite:::parseJSON(txt, bigint_as_char)
   5.         └─jsonlite:::parse_con(txt, bigint_as_char)
   6.           ├─base::open(con, "rb")
   7.           └─base::open.connection(con, "rb")
  ── Error ('test-sc_get_params.R:39:3'): sc_get_params for county parameters ────
  Error in `open.connection(con, "rb")`: cannot open the connection to 'https://api.epa.gov/StreamCat/streams/metrics'
  Backtrace:
      ▆
   1. └─StreamCatTools::sc_get_params(param = "county") at test-sc_get_params.R:39:3
   2.   └─jsonlite::fromJSON("https://api.epa.gov/StreamCat/streams/metrics")
   3.     └─jsonlite:::parse_and_simplify(...)
   4.       └─jsonlite:::parseJSON(txt, bigint_as_char)
   5.         └─jsonlite:::parse_con(txt, bigint_as_char)
   6.           ├─base::open(con, "rb")
   7.           └─base::open.connection(con, "rb")
  ── Error ('test-sc_getdata.R:28:3'): sc_get_data for a hydroregion and ws metrics returns a data frame ──
  <httr2_http_504/httr2_http/httr2_error/rlang_error/rlang_error/error/condition>
  Error in `httr2::req_perform(httr2::req_retry(httr2::req_throttle(httr2::req_body_form(httr2::req_method(httr2::req_headers(httr2::req_method(req, 
      "POST"), `Content-Type` = "application/x-www-form-urlencoded"), 
      "POST"), !!!header_data), rate = 30/60), backoff = ~5, max_tries = 3))`: HTTP 504 Gateway Timeout.
  Backtrace:
       ▆
    1. └─StreamCatTools::sc_get_data(...) at test-sc_getdata.R:28:3
    2.   ├─jsonlite::fromJSON(...)
    3.   ├─httr2::resp_body_string(...)
    4.   │ └─httr2:::check_response(resp)
    5.   │   └─httr2:::is_response(resp)
    6.   └─httr2::req_perform(...)
    7.     └─httr2:::handle_resp(req, resp, error_call = error_call)
    8.       └─httr2:::resp_failure_cnd(req, resp, error_call = error_call)
    9.         ├─rlang::catch_cnd(...)
   10.         │ ├─rlang::eval_bare(...)
   11.         │ ├─base::tryCatch(...)
   12.         │ │ └─base (local) tryCatchList(expr, classes, parentenv, handlers)
   13.         │ │   └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
   14.         │ │     └─base (local) doTryCatch(return(expr), name, parentenv, handler)
   15.         │ └─base::force(expr)
   16.         └─rlang::abort(...)
  ── Error ('test-sc_getdata.R:36:3'): sc_get_data for a county and ws metrics returns a data frame ──
  Error in `open.connection(con, "rb")`: cannot open the connection to 'https://api.epa.gov/StreamCat/streams/metrics'
  Backtrace:
      ▆
   1. └─StreamCatTools::sc_get_data(...) at test-sc_getdata.R:36:3
   2.   └─StreamCatTools::sc_get_params(param = "metric_names")
   3.     └─jsonlite::fromJSON("https://api.epa.gov/StreamCat/streams/metrics")
   4.       └─jsonlite:::parse_and_simplify(...)
   5.         └─jsonlite:::parseJSON(txt, bigint_as_char)
   6.           └─jsonlite:::parse_con(txt, bigint_as_char)
   7.             ├─base::open(con, "rb")
   8.             └─base::open.connection(con, "rb")
  
  [ FAIL 10 | WARN 7 | SKIP 0 | PASS 50 ]
  Error: Test failures
  Execution halted