Running ‘testthat.R’ [2s/103s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(danstat)
  > 
  > test_check("danstat")
  [ FAIL 8 | WARN 0 | SKIP 0 | PASS 4 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error (test-get_data.R:18:2): error behavior with wrong and correct user input ──
  Error in `curl::curl_fetch_memory(url, handle = handle)`: Timeout was reached: [api.statbank.dk] Connection timeout after 10001 ms
  Backtrace:
       ▆
    1. ├─testthat::expect_true(check_variables_code("folk1c", user_input = user_input_bad_values)) at test-get_data.R:18:8
    2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
    3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
    4. └─danstat:::check_variables_code("folk1c", user_input = user_input_bad_values)
    5.   └─danstat::get_table_metadata(table_id = table_id, variables_only = TRUE)
    6.     └─httr::POST(METADATA_ENDPOINT, body = call_body, encode = "json")
    7.       └─httr:::request_perform(req, hu$handle$handle)
    8.         ├─httr:::request_fetch(req$output, req$url, handle)
    9.         └─httr:::request_fetch.write_memory(req$output, req$url, handle)
   10.           └─curl::curl_fetch_memory(url, handle = handle)
  ── Error (test-get_data.R:29:2): warning with wrong variable values ────────────
  Error in `curl::curl_fetch_memory(url, handle = handle)`: Timeout was reached: [api.statbank.dk] Connection timeout after 10001 ms
  Backtrace:
       ▆
    1. ├─testthat::expect_warning(get_data(table_id = "folk1c", variables = user_input_bad_values)) at test-get_data.R:29:8
    2. │ └─testthat:::quasi_capture(enquo(object), label, capture_warnings)
    3. │   ├─testthat .capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─danstat::get_data(table_id = "folk1c", variables = user_input_bad_values)
    7.   └─danstat:::make_variable_input(table_id, variables)
    8.     └─danstat:::check_variables_code(table_id, user_input)
    9.       └─danstat::get_table_metadata(table_id = table_id, variables_only = TRUE)
   10.         └─httr::POST(METADATA_ENDPOINT, body = call_body, encode = "json")
   11.           └─httr:::request_perform(req, hu$handle$handle)
   12.             ├─httr:::request_fetch(req$output, req$url, handle)
   13.             └─httr:::request_fetch.write_memory(req$output, req$url, handle)
   14.               └─curl::curl_fetch_memory(url, handle = handle)
  ── Error (test-get_data.R:33:2): correct column names and output class ─────────
  Error in `curl::curl_fetch_memory(url, handle = handle)`: Timeout was reached: [api.statbank.dk] Connection timeout after 10001 ms
  Backtrace:
       ▆
    1. ├─testthat::expect_equal(...) at test-get_data.R:33:8
    2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
    3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
    4. ├─base::tolower(colnames(get_data(table_id = "folk1c", variables = user_input)))
    5. ├─base::colnames(get_data(table_id = "folk1c", variables = user_input))
    6. │ └─base::is.data.frame(x)
    7. └─danstat::get_data(table_id = "folk1c", variables = user_input)
    8.   └─danstat:::make_variable_input(table_id, variables)
    9.     └─danstat:::check_variables_code(table_id, user_input)
   10.       └─danstat::get_table_metadata(table_id = table_id, variables_only = TRUE)
   11.         └─httr::POST(METADATA_ENDPOINT, body = call_body, encode = "json")
   12.           └─httr:::request_perform(req, hu$handle$handle)
   13.             ├─httr:::request_fetch(req$output, req$url, handle)
   14.             └─httr:::request_fetch.write_memory(req$output, req$url, handle)
   15.               └─curl::curl_fetch_memory(url, handle = handle)
  ── Error (test-get_subjects.R:2:2): get_subjects no inputs works ───────────────
  Error in `curl::curl_fetch_memory(url, handle = handle)`: Timeout was reached: [api.statbank.dk] Connection timeout after 10000 ms
  Backtrace:
      ▆
   1. ├─testthat::expect_is(get_subjects(), "data.frame") at test-get_subjects.R:2:8
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─danstat::get_subjects()
   5.   └─httr::POST(SUBJECTS_ENDPOINT, body = call_body, encode = "json")
   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 (test-get_subjects.R:7:2): get_subjects recursive works ───────────────
  Error in `curl::curl_fetch_memory(url, handle = handle)`: Timeout was reached: [api.statbank.dk] Connection timeout after 10000 ms
  Backtrace:
      ▆
   1. └─danstat::get_subjects(recursive = TRUE) at test-get_subjects.R:7:8
   2.   └─httr::POST(SUBJECTS_ENDPOINT, body = call_body, encode = "json")
   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 (test-get_table_metadata.R:6:2): returns the right object class ───────
  Error in `curl::curl_fetch_memory(url, handle = handle)`: Timeout was reached: [api.statbank.dk] Connection timeout after 10000 ms
  Backtrace:
      ▆
   1. ├─testthat::expect_is(...) at test-get_table_metadata.R:6:8
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─danstat::get_table_metadata(table_id = "folk1a")
   5.   └─httr::POST(METADATA_ENDPOINT, body = call_body, encode = "json")
   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 (test-get_table_metadata.R:12:2): get_valid_variable_names returns correct values ──
  Error in `curl::curl_fetch_memory(url, handle = handle)`: Timeout was reached: [api.statbank.dk] Connection timeout after 10009 ms
  Backtrace:
       ▆
    1. ├─testthat::expect_equal(...) at test-get_table_metadata.R:12:8
    2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
    3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
    4. └─danstat:::get_valid_variable_values("folk1c", "køn")
    5.   └─danstat::get_table_metadata(table_id = table_id, variables_only = TRUE)
    6.     └─httr::POST(METADATA_ENDPOINT, body = call_body, encode = "json")
    7.       └─httr:::request_perform(req, hu$handle$handle)
    8.         ├─httr:::request_fetch(req$output, req$url, handle)
    9.         └─httr:::request_fetch.write_memory(req$output, req$url, handle)
   10.           └─curl::curl_fetch_memory(url, handle = handle)
  ── Error (test-get_tables.R:2:3): subject 'as is' I() works ────────────────────
  Error in `curl::curl_fetch_memory(url, handle = handle)`: Timeout was reached: [api.statbank.dk] Connection timeout after 10000 ms
  Backtrace:
      ▆
   1. ├─testthat::expect_identical(get_tables(subjects = "3465"), get_tables(subjects = c("3465"))) at test-get_tables.R:2:2
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. └─danstat::get_tables(subjects = "3465")
   5.   └─httr::POST(TABLES_ENDPOINT, body = call_body, encode = "json")
   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 8 | WARN 0 | SKIP 0 | PASS 4 ]
  Error: Test failures
  Execution halted