Running ‘testthat.R’ [5s/58s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library("testthat")
  > library("dataverse")
  > 
  > if (!requireNamespace("yaml", quietly = TRUE)) {
  +   warning("The 'yaml' package must be present to test the dataverse package.")
  + } else if (!requireNamespace("checkmate", quietly = TRUE)) {
  +   warning("The 'checkmate' package must be present to test the dataverse package.")
  + } else {
  +   server  <- Sys.getenv("DATAVERSE_SERVER")
  +   key     <- Sys.getenv("DATAVERSE_KEY")
  + 
  +   if (server == "" | key == "") {
  +     config  <- yaml::read_yaml(system.file("constants.yml", package="dataverse"))
  +     # config  <- yaml::read_yaml("inst/constants.yml")
  + 
  +     Sys.setenv("DATAVERSE_SERVER" = config$server)
  +     Sys.setenv("DATAVERSE_KEY"    = config$api_token)
  + 
  +     if (as.Date(config$api_token_expiration) < Sys.Date()) {
  +       stop(
  +         "The API token expired on `",
  +         config$api_token_expiration,
  +         "`, so the tests would probably fail.  ",
  +         "Please regenerate a new token and update `inst/constants.yml`"
  +       )
  +     }
  +     rm(config)
  +   }
  +   rm(server, key)
  + 
  +   message("Using Dataverse server `", Sys.getenv("DATAVERSE_SERVER"), "`.")
  + 
  +   test_check("dataverse")
  + }
  Using Dataverse server `demo.dataverse.org`.
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error (tests-dataset_files.R:6: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:6: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:6:3): check metadata format ─────────────────
  Error: SSL certificate problem: certificate has expired
  Backtrace:
      █
   1. └─dataverse::get_dataverse("dataverse-client-r") tests-dataset_metadata.R:6: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:18:3): check versions format ────────────────
  Error: SSL certificate problem: certificate has expired
  Backtrace:
      █
   1. └─dataverse::get_dataverse("dataverse-client-r") tests-dataset_metadata.R:18: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-dataverse_contents.R:7:3): dataverse root ──────────────────────
  Error: SSL certificate problem: certificate has expired
  Backtrace:
      █
   1. └─dataverse::get_dataverse(dataverse = ":root") tests-dataverse_contents.R:7: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-dataverse_contents.R:29:3): dataverse for 'dataverse-client-r' ──
  Error: SSL certificate problem: certificate has expired
  Backtrace:
      █
   1. └─dataverse::get_dataverse(dataverse = "dataverse-client-r") tests-dataverse_contents.R:29: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-get_dataframe-dataframe-basketball.R:9:3): roster-by-name ──────
  Error: Could not retrieve Dataset ID from persistent identifier!
  Backtrace:
      █
   1. └─dataverse::get_dataframe_by_name(...) tests-get_dataframe-dataframe-basketball.R:9:2
   2.   └─dataverse:::get_fileid.character(...)
   3.     └─dataverse::dataset_files(...)
   4.       ├─dataverse:::dataset_id(dataset, key = key, server = server, ...)
   5.       └─dataverse:::dataset_id.character(...)
   6.         └─base::tryCatch(...)
   7.           └─base:::tryCatchList(expr, classes, parentenv, handlers)
   8.             └─base:::tryCatchOne(expr, names, parentenv, handlers[[1L]])
   9.               └─value[[3L]](cond)
  ── Error (tests-get_dataframe-dataframe-basketball.R:23:3): roster-by-doi ──────
  Error: read-in function was left NULL, but the target file is not ingested or you asked for the original version. Please supply a .f argument.
  
  Backtrace:
      █
   1. └─dataverse::get_dataframe_by_doi(...) tests-get_dataframe-dataframe-basketball.R:23:2
   2.   └─dataverse::get_dataframe_by_id(...)
  ── Error (tests-get_dataframe-dataframe-basketball.R:36:3): roster-by-id ───────
  Error: read-in function was left NULL, but the target file is not ingested or you asked for the original version. Please supply a .f argument.
  
  Backtrace:
      █
   1. └─dataverse::get_dataframe_by_id(...) tests-get_dataframe-dataframe-basketball.R:36:2
  ── Error (tests-get_dataframe-original-basketball.R:24:3): roster-by-name ──────
  Error: Could not retrieve Dataset ID from persistent identifier!
  Backtrace:
      █
   1. └─dataverse::get_dataframe_by_name(...) tests-get_dataframe-original-basketball.R:24:2
   2.   └─dataverse:::get_fileid.character(...)
   3.     └─dataverse::dataset_files(...)
   4.       ├─dataverse:::dataset_id(dataset, key = key, server = server, ...)
   5.       └─dataverse:::dataset_id.character(...)
   6.         └─base::tryCatch(...)
   7.           └─base:::tryCatchList(expr, classes, parentenv, handlers)
   8.             └─base:::tryCatchOne(expr, names, parentenv, handlers[[1L]])
   9.               └─value[[3L]](cond)
  ── Error (tests-get_dataframe-original-basketball.R:59:3): roster-by-doi ───────
  Error: SSL certificate problem: certificate has expired
  Backtrace:
      █
   1. └─dataverse::get_dataframe_by_doi(...) tests-get_dataframe-original-basketball.R:59:2
   2.   └─dataverse::get_dataframe_by_id(...)
   3.     └─dataverse::get_file(file = fileid, original = original, ...)
   4.       └─dataverse::get_file_by_id(...)
   5.         └─httr::GET(...)
   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-get_dataframe-original-basketball.R:80:3): roster-by-id ────────
  Error: SSL certificate problem: certificate has expired
  Backtrace:
      █
   1. └─dataverse::get_dataframe_by_id(...) tests-get_dataframe-original-basketball.R:80:2
   2.   └─dataverse::get_file(file = fileid, original = original, ...)
   3.     └─dataverse::get_file_by_id(...)
   4.       └─httr::GET(...)
   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)
  ── Error (tests-get_dataframe-original-basketball.R:101:3): image-by-name ──────
  Error: Could not retrieve Dataset ID from persistent identifier!
  Backtrace:
      █
   1. └─dataverse::get_dataframe_by_name(...) tests-get_dataframe-original-basketball.R:101:2
   2.   └─dataverse:::get_fileid.character(...)
   3.     └─dataverse::dataset_files(...)
   4.       ├─dataverse:::dataset_id(dataset, key = key, server = server, ...)
   5.       └─dataverse:::dataset_id.character(...)
   6.         └─base::tryCatch(...)
   7.           └─base:::tryCatchList(expr, classes, parentenv, handlers)
   8.             └─base:::tryCatchOne(expr, names, parentenv, handlers[[1L]])
   9.               └─value[[3L]](cond)
  ── Error (tests-get_dataframe-original-basketball.R:120:3): image-by-doi ───────
  Error: SSL certificate problem: certificate has expired
  Backtrace:
      █
   1. └─dataverse::get_dataframe_by_doi(...) tests-get_dataframe-original-basketball.R:120:2
   2.   └─dataverse::get_dataframe_by_id(...)
   3.     └─dataverse::get_file(file = fileid, original = original, ...)
   4.       └─dataverse::get_file_by_id(...)
   5.         └─httr::GET(...)
   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-get_dataframe-original-basketball.R:138:3): image-by-id ────────
  Error: SSL certificate problem: certificate has expired
  Backtrace:
      █
   1. └─dataverse::get_dataframe_by_id(...) tests-get_dataframe-original-basketball.R:138:2
   2.   └─dataverse::get_file(file = fileid, original = original, ...)
   3.     └─dataverse::get_file_by_id(...)
   4.       └─httr::GET(...)
   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)
  ── Error (tests-get_dataset.R:6:3): download tab from DOI and filename ─────────
  Error: SSL certificate problem: certificate has expired
  Backtrace:
      █
   1. └─dataverse::get_dataverse("dataverse-client-r") tests-get_dataset.R:6: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-get_dataverse.R:8:3): dataverse root ───────────────────────────
  Error: SSL certificate problem: certificate has expired
  Backtrace:
      █
   1. └─dataverse::get_dataverse(dataverse = expected$testing_name) tests-get_dataverse.R:8: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-get_dataverse.R:22:3): dataverse for 'dataverse-client-r' ──────
  Error: SSL certificate problem: certificate has expired
  Backtrace:
      █
   1. └─dataverse::get_dataverse(dataverse = expected$testing_name) tests-get_dataverse.R:22: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-get_file.R:8:3): download tab from DOI and filename ────────────
  Error: Could not retrieve Dataset ID from persistent identifier!
  Backtrace:
      █
   1. └─dataverse::get_file(file = "roster-bulls-1996.tab", dataset = "doi:10.70122/FK2/HXJVJU") tests-get_file.R:8:2
   2.   └─dataverse:::get_fileid.character(...)
   3.     └─dataverse::dataset_files(...)
   4.       ├─dataverse:::dataset_id(dataset, key = key, server = server, ...)
   5.       └─dataverse:::dataset_id.character(...)
   6.         └─base::tryCatch(...)
   7.           └─base:::tryCatchList(expr, classes, parentenv, handlers)
   8.             └─base:::tryCatchOne(expr, names, parentenv, handlers[[1L]])
   9.               └─value[[3L]](cond)
  ── Error (tests-get_file.R:18:3): download tab from file id ────────────────────
  Error: SSL certificate problem: certificate has expired
  Backtrace:
      █
   1. └─dataverse::get_file(file = 1734005L) tests-get_file.R:18:2
   2.   └─dataverse::get_file_by_id(...)
   3.     └─httr::GET(...)
   4.       └─httr:::request_perform(req, hu$handle$handle)
   5.         ├─httr:::request_fetch(req$output, req$url, handle)
   6.         └─httr:::request_fetch.write_memory(req$output, req$url, handle)
   7.           └─curl::curl_fetch_memory(url, handle = handle)
  ── Error (tests-get_file.R:28:3): download multiple files with file id - no folder ──
  Error: Could not retrieve Dataset ID from persistent identifier!
  Backtrace:
      █
   1. └─dataverse::get_dataset("doi:10.70122/FK2/HXJVJU", server = "demo.dataverse.org") tests-get_file.R:28:2
   2.   ├─dataverse:::dataset_id(dataset, key = key, server = server, ...)
   3.   └─dataverse:::dataset_id.character(...)
   4.     └─base::tryCatch(...)
   5.       └─base:::tryCatchList(expr, classes, parentenv, handlers)
   6.         └─base:::tryCatchOne(expr, names, parentenv, handlers[[1L]])
   7.           └─value[[3L]](cond)
  ── Error (tests-get_file.R:42:3): download multiple files with file id - with folders ──
  Error: Could not retrieve Dataset ID from persistent identifier!
  Backtrace:
      █
   1. └─dataverse::get_dataset("doi:10.70122/FK2/HXJVJU", server = "demo.dataverse.org") tests-get_file.R:42:2
   2.   ├─dataverse:::dataset_id(dataset, key = key, server = server, ...)
   3.   └─dataverse:::dataset_id.character(...)
   4.     └─base::tryCatch(...)
   5.       └─base:::tryCatchList(expr, classes, parentenv, handlers)
   6.         └─base:::tryCatchOne(expr, names, parentenv, handlers[[1L]])
   7.           └─value[[3L]](cond)
  ── Failure (tests-get_file.R:53:3): More informative error message when file does not exist ──
  `get_file(2972336, server = "demo.dataverse.org")` threw an error with unexpected message.
  Expected match: "API endpoint does not exist on this server"
  Actual message: "SSL certificate problem: certificate has expired"
  Backtrace:
       █
    1. ├─testthat::expect_error(...) tests-get_file.R:53:2
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat:::.capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─dataverse::get_file(2972336, server = "demo.dataverse.org")
    7.   └─dataverse::get_file_by_id(...)
    8.     └─httr::GET(...)
    9.       └─httr:::request_perform(req, hu$handle$handle)
   10.         ├─httr:::request_fetch(req$output, req$url, handle)
   11.         └─httr:::request_fetch.write_memory(req$output, req$url, handle)
   12.           └─curl::curl_fetch_memory(url, handle = handle)
  ── Error (tests-get_file_metadata.R:8:3): get file metadata from DOI and filename ──
  Error: Could not retrieve Dataset ID from persistent identifier!
  Backtrace:
       █
    1. └─dataverse::get_file_metadata(...) tests-get_file_metadata.R:8:2
    2.   ├─dataverse:::get_fileid(...)
    3.   └─dataverse:::get_fileid.character(...)
    4.     └─dataverse::dataset_files(...)
    5.       ├─dataverse:::dataset_id(dataset, key = key, server = server, ...)
    6.       └─dataverse:::dataset_id.character(...)
    7.         └─base::tryCatch(...)
    8.           └─base:::tryCatchList(expr, classes, parentenv, handlers)
    9.             └─base:::tryCatchOne(expr, names, parentenv, handlers[[1L]])
   10.               └─value[[3L]](cond)
  ── Error (tests-get_file_metadata.R:18:3): get file metadata from file id ──────
  Error: SSL certificate problem: certificate has expired
  Backtrace:
      █
   1. └─dataverse::get_file_metadata(file = 1734005) tests-get_file_metadata.R:18:2
   2.   └─httr::GET(u, httr::add_headers(`X-Dataverse-key` = key), ...)
   3.     └─httr:::request_perform(req, hu$handle$handle)
   4.       ├─httr:::request_fetch(req$output, req$url, handle)
   5.       └─httr:::request_fetch.write_memory(req$output, req$url, handle)
   6.         └─curl::curl_fetch_memory(url, handle = handle)
  ── Error (tests-list_datasets.R:25:3): dataverse root ──────────────────────────
  Error: SSL certificate problem: certificate has expired
  Backtrace:
      █
   1. └─dataverse::get_dataverse(":root") tests-list_datasets.R:25: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-list_datasets.R:59:3): dataverse for 'dataverse-client-r' ──────
  Error: SSL certificate problem: certificate has expired
  Backtrace:
      █
   1. └─dataverse::get_dataverse("dataverse-client-r") tests-list_datasets.R:59: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)
  
  [ FAIL 26 | WARN 0 | SKIP 0 | PASS 10 ]
  Error: Test failures
  Execution halted