Running ‘spelling.R’ [0s/1s]
  Running ‘testthat.R’ [0m/13m]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > 
  > options(epigraphdb.ci = TRUE)
  > test_check("epigraphdb")
  Loading required package: epigraphdb
  
      EpiGraphDB v1.0 (API: https://api.epigraphdb.org)
    
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Failure (test-confounder.R:14:3): /confounder ───────────────────────────────
  httr::status_code(r) not equal to 200.
  1/1 mismatches
  [1] 500 - 200 == 300
  ── Failure (test-confounder.R:21:3): confounder ────────────────────────────────
  `confounder(exposure_trait = exposure, outcome_trait = outcome)` threw an error.
  Message: Internal Server Error (HTTP 500).
  Detail:
  [1] "Internal Server Error"do.call(method, args = list(route = route, params = params, retry_times = retry_times, retry_pause_min = retry_pause_min, call = call))
  Class:   simpleError/error/condition
  Backtrace:
       █
    1. ├─testthat::expect_error(...) test-confounder.R:21:2
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat:::.capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─epigraphdb::confounder(exposure_trait = exposure, outcome_trait = outcome)
    7.   └─epigraphdb::query_epigraphdb(...)
    8.     └─epigraphdb:::api_request(...)
    9.       ├─base::do.call(...)
   10.       └─(function (route, params, retry_times, retry_pause_min, call = sys.call(-1)) ...
   11.         └─epigraphdb:::stop_for_status(response, call = sys.call(-1))
  ── Failure (test-drugs.R:12:3): /drugs/risk-factors ────────────────────────────
  httr::status_code(r) not equal to 200.
  1/1 mismatches
  [1] 500 - 200 == 300
  ── Failure (test-drugs.R:18:3): drugs_risk_factors ─────────────────────────────
  `drugs_risk_factors(trait = trait)` threw an error.
  Message: Internal Server Error (HTTP 500).
  Detail:
  [1] "Internal Server Error"do.call(method, args = list(route = route, params = params, retry_times = retry_times, retry_pause_min = retry_pause_min, call = call))
  Class:   simpleError/error/condition
  Backtrace:
       █
    1. ├─testthat::expect_error(drugs_risk_factors(trait = trait), NA) test-drugs.R:18:2
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat:::.capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─epigraphdb::drugs_risk_factors(trait = trait)
    7.   └─epigraphdb::query_epigraphdb(...)
    8.     └─epigraphdb:::api_request(...)
    9.       ├─base::do.call(...)
   10.       └─(function (route, params, retry_times, retry_pause_min, call = sys.call(-1)) ...
   11.         └─epigraphdb:::stop_for_status(response, call = sys.call(-1))
  ── Failure (test-genetic_cor.R:12:3): genetic_cor endpoint ─────────────────────
  httr::status_code(r) not equal to 200.
  1/1 mismatches
  [1] 500 - 200 == 300
  ── Failure (test-genetic_cor.R:18:3): genetic_cor mode = "table" ───────────────
  `df <- genetic_cor(trait = trait)` threw an error.
  Message: Internal Server Error (HTTP 500).
  Detail:
  [1] "Internal Server Error"do.call(method, args = list(route = route, params = params, retry_times = retry_times, retry_pause_min = retry_pause_min, call = call))
  Class:   simpleError/error/condition
  Backtrace:
       █
    1. ├─testthat::expect_error(df <- genetic_cor(trait = trait), NA) test-genetic_cor.R:18:2
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat:::.capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─epigraphdb::genetic_cor(trait = trait)
    7.   └─epigraphdb::query_epigraphdb(...)
    8.     └─epigraphdb:::api_request(...)
    9.       ├─base::do.call(...)
   10.       └─(function (route, params, retry_times, retry_pause_min, call = sys.call(-1)) ...
   11.         └─epigraphdb:::stop_for_status(response, call = sys.call(-1))
  ── Failure (test-genetic_cor.R:24:3): genetic_cor mode = "table" ───────────────
  `df` inherits from `'function'` not `'character'`.
  ── Failure (test-genetic_cor.R:29:3): genetic_cor mode = "raw" ─────────────────
  `response <- genetic_cor(trait = trait, mode = "raw")` threw an error.
  Message: Internal Server Error (HTTP 500).
  Detail:
  [1] "Internal Server Error"do.call(method, args = list(route = route, params = params, retry_times = retry_times, retry_pause_min = retry_pause_min, call = call))
  Class:   simpleError/error/condition
  Backtrace:
       █
    1. ├─testthat::expect_error(...) test-genetic_cor.R:29:2
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat:::.capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─epigraphdb::genetic_cor(trait = trait, mode = "raw")
    7.   └─epigraphdb::query_epigraphdb(...)
    8.     └─epigraphdb:::api_request(...)
    9.       ├─base::do.call(...)
   10.       └─(function (route, params, retry_times, retry_pause_min, call = sys.call(-1)) ...
   11.         └─epigraphdb:::stop_for_status(response, call = sys.call(-1))
  ── Error (test-genetic_cor.R:36:3): genetic_cor mode = "raw" ───────────────────
  Error in `eval_bare(expr, quo_get_env(quo))`: object 'response' not found
  Backtrace:
      █
   1. └─testthat::expect_equal(length(response), 2L) test-genetic_cor.R:36:2
   2.   └─testthat::quasi_label(enquo(object), label, arg = "object")
   3.     └─rlang::eval_bare(expr, quo_get_env(quo))
  ── Failure (test-genetic_cor.R:41:3): genetic_cor cor_coef_threshold ───────────
  `response <- genetic_cor(trait = trait, cor_coef_threshold = 0.8)` threw an error.
  Message: Internal Server Error (HTTP 500).
  Detail:
  [1] "Internal Server Error"do.call(method, args = list(route = route, params = params, retry_times = retry_times, retry_pause_min = retry_pause_min, call = call))
  Class:   simpleError/error/condition
  Backtrace:
       █
    1. ├─testthat::expect_error(...) test-genetic_cor.R:41:2
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat:::.capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─epigraphdb::genetic_cor(trait = trait, cor_coef_threshold = 0.8)
    7.   └─epigraphdb::query_epigraphdb(...)
    8.     └─epigraphdb:::api_request(...)
    9.       ├─base::do.call(...)
   10.       └─(function (route, params, retry_times, retry_pause_min, call = sys.call(-1)) ...
   11.         └─epigraphdb:::stop_for_status(response, call = sys.call(-1))
  ── Failure (test-genetic_cor.R:48:3): genetic_cor cor_coef_threshold ───────────
  `response <- genetic_cor(trait = trait, cor_coef_threshold = 0.6)` threw an error.
  Message: Internal Server Error (HTTP 500).
  Detail:
  [1] "Internal Server Error"do.call(method, args = list(route = route, params = params, retry_times = retry_times, retry_pause_min = retry_pause_min, call = call))
  Class:   simpleError/error/condition
  Backtrace:
       █
    1. ├─testthat::expect_error(...) test-genetic_cor.R:48:2
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat:::.capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─epigraphdb::genetic_cor(trait = trait, cor_coef_threshold = 0.6)
    7.   └─epigraphdb::query_epigraphdb(...)
    8.     └─epigraphdb:::api_request(...)
    9.       ├─base::do.call(...)
   10.       └─(function (route, params, retry_times, retry_pause_min, call = sys.call(-1)) ...
   11.         └─epigraphdb:::stop_for_status(response, call = sys.call(-1))
  ── Failure (test-genetic_cor.R:55:3): genetic_cor cor_coef_threshold ───────────
  `response <- genetic_cor(trait = trait, cor_coef_threshold = 0.4)` threw an error.
  Message: Internal Server Error (HTTP 500).
  Detail:
  [1] "Internal Server Error"do.call(method, args = list(route = route, params = params, retry_times = retry_times, retry_pause_min = retry_pause_min, call = call))
  Class:   simpleError/error/condition
  Backtrace:
       █
    1. ├─testthat::expect_error(...) test-genetic_cor.R:55:2
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat:::.capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─epigraphdb::genetic_cor(trait = trait, cor_coef_threshold = 0.4)
    7.   └─epigraphdb::query_epigraphdb(...)
    8.     └─epigraphdb:::api_request(...)
    9.       ├─base::do.call(...)
   10.       └─(function (route, params, retry_times, retry_pause_min, call = sys.call(-1)) ...
   11.         └─epigraphdb:::stop_for_status(response, call = sys.call(-1))
  ── Failure (test-literature.R:14:3): /literature/gwas ──────────────────────────
  httr::status_code(r) not equal to 200.
  1/1 mismatches
  [1] 500 - 200 == 300
  ── Failure (test-literature.R:20:3): literature_gwas ───────────────────────────
  `literature_gwas(trait = trait)` threw an error.
  Message: Internal Server Error (HTTP 500).
  Detail:
  [1] "Internal Server Error"do.call(method, args = list(route = route, params = params, retry_times = retry_times, retry_pause_min = retry_pause_min, call = call))
  Class:   simpleError/error/condition
  Backtrace:
       █
    1. ├─testthat::expect_error(literature_gwas(trait = trait), NA) test-literature.R:20:2
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat:::.capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─epigraphdb::literature_gwas(trait = trait)
    7.   └─epigraphdb::query_epigraphdb(...)
    8.     └─epigraphdb:::api_request(...)
    9.       ├─base::do.call(...)
   10.       └─(function (route, params, retry_times, retry_pause_min, call = sys.call(-1)) ...
   11.         └─epigraphdb:::stop_for_status(response, call = sys.call(-1))
  ── Failure (test-mappings.R:16:3): POST /mappings/gene-to-protein ──────────────
  httr::status_code(r) not equal to 200.
  1/1 mismatches
  [1] 500 - 200 == 300
  ── Failure (test-mappings.R:22:3): mappings_gene_to_protein, by gene name ──────
  `df <- mappings_gene_to_protein(gene_name_list = gene_name_list)` threw an error.
  Message: Internal Server Error (HTTP 500).
  Detail:
  [1] "Internal Server Error"do.call(method, args = list(route = route, params = params, retry_times = retry_times, retry_pause_min = retry_pause_min, call = call))
  Class:   simpleError/error/condition
  Backtrace:
       █
    1. ├─testthat::expect_error(...) test-mappings.R:22:2
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat:::.capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─epigraphdb::mappings_gene_to_protein(gene_name_list = gene_name_list)
    7.   └─epigraphdb::query_epigraphdb(...)
    8.     └─epigraphdb:::api_request(...)
    9.       ├─base::do.call(...)
   10.       └─(function (route, params, retry_times, retry_pause_min, call = sys.call(-1)) ...
   11.         └─epigraphdb:::stop_for_status(response, call = sys.call(-1))
  ── Failure (test-mappings.R:28:3): mappings_gene_to_protein, by gene name ──────
  `df` inherits from `'function'` not `'character'`.
  ── Failure (test-mappings.R:33:3): mappings_gene_to_protein, by gene name, singleton ──
  `df <- mappings_gene_to_protein(gene_name_list = gene_name_list)` threw an error.
  Message: Internal Server Error (HTTP 500).
  Detail:
  [1] "Internal Server Error"do.call(method, args = list(route = route, params = params, retry_times = retry_times, retry_pause_min = retry_pause_min, call = call))
  Class:   simpleError/error/condition
  Backtrace:
       █
    1. ├─testthat::expect_error(...) test-mappings.R:33:2
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat:::.capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─epigraphdb::mappings_gene_to_protein(gene_name_list = gene_name_list)
    7.   └─epigraphdb::query_epigraphdb(...)
    8.     └─epigraphdb:::api_request(...)
    9.       ├─base::do.call(...)
   10.       └─(function (route, params, retry_times, retry_pause_min, call = sys.call(-1)) ...
   11.         └─epigraphdb:::stop_for_status(response, call = sys.call(-1))
  ── Failure (test-mappings.R:39:3): mappings_gene_to_protein, by gene name, singleton ──
  `df` inherits from `'function'` not `'character'`.
  ── Failure (test-request_and_response.R:59:3): query_epigraphdb POST 2 ─────────
  `... <- NULL` threw an error.
  Message: Bad Gateway (HTTP 502).
  Detail:
  {html_document}
  <html>
  [1] <head>\n<meta http-equiv="Content-Type" content="text/html; charset=UTF-8 ...
  [2] <body>\n<h1>Proxy Error</h1>\n<p>The proxy server received an invalid\r\n ...do.call(method, args = list(route = route, params = params, retry_times = retry_times, retry_pause_min = retry_pause_min, call = call))
  Class:   simpleError/error/condition
  Backtrace:
       █
    1. ├─testthat::expect_error(...) test-request_and_response.R:59:2
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat:::.capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. └─epigraphdb::query_epigraphdb(...)
    7.   └─epigraphdb:::api_request(...)
    8.     ├─base::do.call(...)
    9.     └─(function (route, params, retry_times, retry_pause_min, call = sys.call(-1)) ...
   10.       └─epigraphdb:::stop_for_status(response, call = sys.call(-1))
  ── Error (test-request_and_response.R:78:3): query_epigraphdb POST 2 ───────────
  Error in `eval_bare(expr, quo_get_env(quo))`: object 'results' not found
  Backtrace:
      █
   1. └─testthat::expect_is(results, "tbl_df") test-request_and_response.R:78:2
   2.   └─testthat::quasi_label(enquo(object), label, arg = "object")
   3.     └─rlang::eval_bare(expr, quo_get_env(quo))
  
  [ FAIL 21 | WARN 0 | SKIP 0 | PASS 91 ]
  Error: Test failures
  Execution halted