Running ‘testthat.R’ [0m/29m]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(ieugwasr)
  OpenGWAS updates:
    Date: 2024-03-07
    [>] There is exceptional load on the OpenGWAS servers.
    [>] Urgent infrastructure development being performed.
    [>] See local options for analysis: https://mrcieu.github.io/gwasvcf/.
  > 
  > test_check("ieugwasr")
  [ FAIL 20 | WARN 0 | SKIP 0 | PASS 11 ]
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test_afl2.r:3:1'): (code run outside of `test_that()`) ──────────────
  Error in `as.data.frame.default(value, stringsAsFactors = FALSE)`: cannot coerce class '"response"' to a data.frame
  Backtrace:
      ▆
   1. ├─ieugwasr::afl2_list() at test_afl2.r:3:1
   2. │ └─... %>% return()
   3. ├─dplyr::as_tibble(.)
   4. └─tibble:::as_tibble.default(.)
   5.   ├─tibble::as_tibble(...)
   6.   ├─base::as.data.frame(value, stringsAsFactors = FALSE)
   7.   └─base::as.data.frame.default(value, stringsAsFactors = FALSE)
  ── Error ('test_ld.r:7:1'): (code run outside of `test_that()`) ────────────────
  Error in `ld_clump(b)`: "rsid" %in% names(dat) is not TRUE
  Backtrace:
      ▆
   1. └─ieugwasr::ld_clump(b) at test_ld.r:7:1
   2.   └─base::stopifnot("rsid" %in% names(dat))
  ── Failure ('test_query.r:6:2'): gwasinfo ──────────────────────────────────────
  ... == 1 is not TRUE
  
  `actual`:       
  `expected`: TRUE
  ── Failure ('test_query.r:9:2'): gwasinfo ──────────────────────────────────────
  nrow(...) not equal to 2.
  target is NULL, current is numeric
  ── Error ('test_query.r:13:2'): gwasinfo ───────────────────────────────────────
  Error in `dplyr::bind_rows(out)`: Argument 1 must be a data frame or a named atomic vector.
  Backtrace:
      ▆
   1. ├─testthat::expect_gt(nrow(gwasinfo()), 100) at test_query.r:13:9
   2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
   3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
   4. ├─base::nrow(gwasinfo())
   5. ├─ieugwasr::gwasinfo()
   6. │ ├─dplyr::bind_rows(out) %>% ...
   7. │ └─dplyr::bind_rows(out)
   8. │   └─rlang::abort(glue("Argument {i} must be a data frame or a named atomic vector."))
   9. └─dplyr::select(., "id", "trait", dplyr::everything())
  ── Failure ('test_query.r:21:2'): associations ─────────────────────────────────
  ... == 2 is not TRUE
  
  `actual`:       
  `expected`: TRUE
  ── Failure ('test_query.r:25:2'): associations ─────────────────────────────────
  ... == 1 is not TRUE
  
  `actual`:       
  `expected`: TRUE
  ── Failure ('test_query.r:29:2'): associations ─────────────────────────────────
  ... > 10000 is not TRUE
  
  `actual`:       
  `expected`: TRUE
  ── Error ('test_query.r:37:2'): fill_n ─────────────────────────────────────────
  Error in `dplyr::bind_rows(out)`: Argument 1 must be a data frame or a named atomic vector.
  Backtrace:
      ▆
   1. ├─associations(c("rs12759473"), "bbj-a-10") %>% fill_n at test_query.r:37:9
   2. ├─ieugwasr::fill_n(.)
   3. │ └─ieugwasr::gwasinfo(id)
   4. │   ├─dplyr::bind_rows(out) %>% ...
   5. │   └─dplyr::bind_rows(out)
   6. │     └─rlang::abort(glue("Argument {i} must be a data frame or a named atomic vector."))
   7. └─dplyr::select(., "id", "trait", dplyr::everything())
  ── Failure ('test_query.r:46:2'): phewas ───────────────────────────────────────
  nrow(a) > 100 is not TRUE
  
  `actual`:       
  `expected`: TRUE
  ── Failure ('test_query.r:48:2'): phewas ───────────────────────────────────────
  nrow(b) < nrow(a) is not TRUE
  
  `actual`:       
  `expected`: TRUE
  ── Failure ('test_query.r:49:2'): phewas ───────────────────────────────────────
  nrow(b) > 0 is not TRUE
  
  `actual`:       
  `expected`: TRUE
  ── Failure ('test_query.r:63:2'): phewas ───────────────────────────────────────
  nrow(a) > 10 is not TRUE
  
  `actual`:       
  `expected`: TRUE
  ── Failure ('test_query.r:69:2'): tophits ──────────────────────────────────────
  nrow(tophits("ieu-a-2")) not equal to 79.
  target is NULL, current is numeric
  ── Failure ('test_query.r:70:2'): tophits ──────────────────────────────────────
  nrow(tophits("ieu-a-2", clump = 0)) > 79 is not TRUE
  
  `actual`:       
  `expected`: TRUE
  ── Failure ('test_variants.r:9:2'): genes ──────────────────────────────────────
  nrow(o1) is not strictly more than 0. Difference: 0
  ── Failure ('test_variants.r:10:2'): genes ─────────────────────────────────────
  nrow(o2) is not strictly more than nrow(o1). Difference: 0
  ── Failure ('test_variants.r:17:2'): chrpos ────────────────────────────────────
  nrow(o) > 1 is not TRUE
  
  `actual`:       
  `expected`: TRUE
  ── Failure ('test_variants.r:20:2'): chrpos ────────────────────────────────────
  nrow(o) == 1 is not TRUE
  
  `actual`:       
  `expected`: TRUE
  ── Failure ('test_variants.r:39:2'): conversion ────────────────────────────────
  length(o) == 2 is not TRUE
  
  `actual`:   FALSE
  `expected`: TRUE 
  
  [ FAIL 20 | WARN 0 | SKIP 0 | PASS 11 ]
  Error: Test failures
  Execution halted