Running ‘test-all.R’ [10s/397s]
Running the tests in ‘tests/test-all.R’ failed.
Complete output:
  > library("testthat")
  > test_check("worrms")
  Loading required package: worrms
  Loading required namespace: jsonlite
  ── 1. Error: wm_children - offset parameter works (@test-wm_children.R#28)  ────
  (502) Bad Gateway - 105706
  1: vcr::use_cassette("wm_children_offset", {
         off1 <- wm_children(id = 105706, offset = 1)
         off2 <- wm_children(id = 105706, offset = 2)
         expect_equal(off1$AphiaID[1], 297110)
         expect_equal(off2$AphiaID[1], 398065)
     }, record = "all", match_requests_on = c("method", "uri", "query")) at testthat/test-wm_children.R:28
  2: cassette$call_block(...)
  3: lazyeval::lazy_eval(tmp)
  4: lapply(x, lazy_eval, data = data)
  5: FUN(X[[i]], ...)
  6: eval(x$expr, x$env, emptyenv())
  7: eval(x$expr, x$env, emptyenv())
  8: wm_children(id = 105706, offset = 1) at testthat/test-wm_children.R:29
  9: wm_GET(file.path(wm_base(), "AphiaChildrenByAphiaID", id), query = cc(list(marine_only = as_log(marine_only), 
         offset = offset)), ...)
  10: on_error(sprintf("(%s) %s - %s", temp$status_code, temp$status_http()$message, basename(url)), 
         call. = FALSE)
  
  ── 2. Failure: wm_children_ - 'name' input works (@test-wm_children.R#69)  ─────
  any(grepl("Platanista", aa$scientificname)) isn't true.
  
  ── 3. Failure: wm_children_ - 'name' input works (@test-wm_children.R#69)  ─────
  any(grepl("Leucophaeus", aa$scientificname)) isn't true.
  
  ── 4. Error: wm_classification_ works (@test-wm_classification.R#34)  ──────────
  lexical error: invalid char in json text.
                                         <html><body><h1>502 Bad Gateway
                       (right here) ------^
  1: vcr::use_cassette("wm_classification_many", {
         bb <- wm_classification_(id = c(254967, 344089))
         expect_is(bb, "tbl_df")
         expect_is(bb, "data.frame")
         expect_named(bb, c("id", "AphiaID", "rank", "scientificname"))
     }, record = "all") at testthat/test-wm_classification.R:34
  2: cassette$call_block(...)
  3: lazyeval::lazy_eval(tmp)
  4: lapply(x, lazy_eval, data = data)
  5: FUN(X[[i]], ...)
  6: eval(x$expr, x$env, emptyenv())
  7: eval(x$expr, x$env, emptyenv())
  8: wm_classification_(id = c(254967, 344089)) at testthat/test-wm_classification.R:35
  9: run_bind(id, wm_classification, on_error = warning, ...)
  10: tibble::as_tibble(br(ccn(stats::setNames(lapply(id, fun, ...), id))))
  ...
  16: unlist(lapply(x, f))
  17: lapply(x, f)
  18: stats::setNames(lapply(id, fun, ...), id)
  19: lapply(id, fun, ...)
  20: FUN(X[[i]], ...)
  21: wm_GET(file.path(wm_base(), "AphiaClassificationByAphiaID", id), ...)
  22: jsonlite::fromJSON(temp$parse("UTF-8"), flatten = TRUE)
  23: parse_and_simplify(txt = txt, simplifyVector = simplifyVector, simplifyDataFrame = simplifyDataFrame, 
         simplifyMatrix = simplifyMatrix, flatten = flatten, ...)
  24: parseJSON(txt, bigint_as_char)
  25: parse_string(txt, bigint_as_char)
  
  ── 5. Error: wm_external_ - default usage works (@test-wm_external.R#43)  ──────
  lexical error: invalid char in json text.
                                         <html><body><h1>502 Bad Gateway
                       (right here) ------^
  1: vcr::use_cassette("wm_external_many", {
         bb <- wm_external_(id = c(1080, 126436))
         expect_type(bb, "list")
         expect_named(bb, c("1080", "126436"))
     }, record = "all") at testthat/test-wm_external.R:43
  2: cassette$call_block(...)
  3: lazyeval::lazy_eval(tmp)
  4: lapply(x, lazy_eval, data = data)
  5: FUN(X[[i]], ...)
  6: eval(x$expr, x$env, emptyenv())
  7: eval(x$expr, x$env, emptyenv())
  8: wm_external_(id = c(1080, 126436)) at testthat/test-wm_external.R:44
  9: run_c(id, wm_external, type = type, on_error = warning, ...)
  10: ccn(stats::setNames(lapply(id, fun, ...), id))
  11: Filter(function(z) !is.null(z) && NROW(z) > 0, x)
  12: unlist(lapply(x, f))
  13: lapply(x, f)
  14: stats::setNames(lapply(id, fun, ...), id)
  15: lapply(id, fun, ...)
  16: FUN(X[[i]], ...)
  17: wm_GET(file.path(wm_base(), "AphiaExternalIDByAphiaID", id), query = cc(list(type = type)), 
         ...)
  18: jsonlite::fromJSON(temp$parse("UTF-8"), flatten = TRUE)
  19: parse_and_simplify(txt = txt, simplifyVector = simplifyVector, simplifyDataFrame = simplifyDataFrame, 
         simplifyMatrix = simplifyMatrix, flatten = flatten, ...)
  20: parseJSON(txt, bigint_as_char)
  21: parse_string(txt, bigint_as_char)
  
  ── 6. Error: wm_name2id_ - default usage works (@test-wm_name2id.R#31)  ────────
  lexical error: invalid char in json text.
                                         <html><body><h1>502 Bad Gateway
                       (right here) ------^
  1: vcr::use_cassette("wm_name2id_many", {
         bb <- wm_name2id_(name = c("Rhincodon", "Gadus morhua"))
         expect_type(bb, "list")
         expect_type(bb[[1]], "integer")
         expect_named(bb, c("Rhincodon", "Gadus morhua"))
     }, record = "all") at testthat/test-wm_name2id.R:31
  2: cassette$call_block(...)
  3: lazyeval::lazy_eval(tmp)
  4: lapply(x, lazy_eval, data = data)
  5: FUN(X[[i]], ...)
  6: eval(x$expr, x$env, emptyenv())
  7: eval(x$expr, x$env, emptyenv())
  8: wm_name2id_(name = c("Rhincodon", "Gadus morhua")) at testthat/test-wm_name2id.R:32
  9: run_c(name, wm_name2id, on_error = warning, ...)
  10: ccn(stats::setNames(lapply(id, fun, ...), id))
  11: Filter(function(z) !is.null(z) && NROW(z) > 0, x)
  12: unlist(lapply(x, f))
  13: lapply(x, f)
  14: stats::setNames(lapply(id, fun, ...), id)
  15: lapply(id, fun, ...)
  16: FUN(X[[i]], ...)
  17: wm_GET(file.path(wm_base(), "AphiaIDByName", name), ...)
  18: jsonlite::fromJSON(temp$parse("UTF-8"), flatten = TRUE)
  19: parse_and_simplify(txt = txt, simplifyVector = simplifyVector, simplifyDataFrame = simplifyDataFrame, 
         simplifyMatrix = simplifyMatrix, flatten = flatten, ...)
  20: parseJSON(txt, bigint_as_char)
  21: parse_string(txt, bigint_as_char)
  
  ── 7. Error: wm_record_ - default usage works (@test-wm_record.R#35)  ──────────
  lexical error: invalid char in json text.
                                         <html><body><h1>502 Bad Gateway
                       (right here) ------^
  1: vcr::use_cassette("wm_record_many", {
         bb <- wm_record_(id = c(105706, 126436))
         expect_type(bb, "list")
         expect_named(bb, c("105706", "126436"))
     }, record = "all") at testthat/test-wm_record.R:35
  2: cassette$call_block(...)
  3: lazyeval::lazy_eval(tmp)
  4: lapply(x, lazy_eval, data = data)
  5: FUN(X[[i]], ...)
  6: eval(x$expr, x$env, emptyenv())
  7: eval(x$expr, x$env, emptyenv())
  8: wm_record_(id = c(105706, 126436)) at testthat/test-wm_record.R:36
  9: run_c(id, wm_record, on_error = warning, ...)
  10: ccn(stats::setNames(lapply(id, fun, ...), id))
  11: Filter(function(z) !is.null(z) && NROW(z) > 0, x)
  12: unlist(lapply(x, f))
  13: lapply(x, f)
  14: stats::setNames(lapply(id, fun, ...), id)
  15: lapply(id, fun, ...)
  16: FUN(X[[i]], ...)
  17: wm_GET(file.path(wm_base(), "AphiaRecordByAphiaID", id), ...)
  18: jsonlite::fromJSON(temp$parse("UTF-8"), flatten = TRUE)
  19: parse_and_simplify(txt = txt, simplifyVector = simplifyVector, simplifyDataFrame = simplifyDataFrame, 
         simplifyMatrix = simplifyMatrix, flatten = flatten, ...)
  20: parseJSON(txt, bigint_as_char)
  21: parse_string(txt, bigint_as_char)
  
  ── 8. Error: wm_record_by_external_ - default - by id type tsn (@test-wm_record_
  lexical error: invalid char in json text.
                                         <html><body><h1>502 Bad Gateway
                       (right here) ------^
  1: vcr::use_cassette("wm_record_by_external__many", {
         bb <- wm_record_by_external_(id = c(85257, 159854))
         expect_is(bb, "list")
         expect_named(bb, c("85257", "159854"))
     }, record = "all") at testthat/test-wm_record_by_external.R:52
  2: cassette$call_block(...)
  3: lazyeval::lazy_eval(tmp)
  4: lapply(x, lazy_eval, data = data)
  5: FUN(X[[i]], ...)
  6: eval(x$expr, x$env, emptyenv())
  7: eval(x$expr, x$env, emptyenv())
  8: wm_record_by_external_(id = c(85257, 159854)) at testthat/test-wm_record_by_external.R:53
  9: run_c(id, wm_record_by_external, type = type, on_error = warning, ...)
  10: ccn(stats::setNames(lapply(id, fun, ...), id))
  11: Filter(function(z) !is.null(z) && NROW(z) > 0, x)
  12: unlist(lapply(x, f))
  13: lapply(x, f)
  14: stats::setNames(lapply(id, fun, ...), id)
  15: lapply(id, fun, ...)
  16: FUN(X[[i]], ...)
  17: wm_GET(file.path(wm_base(), "AphiaRecordByExternalID", id), query = cc(list(type = type)), 
         ...)
  18: jsonlite::fromJSON(temp$parse("UTF-8"), flatten = TRUE)
  19: parse_and_simplify(txt = txt, simplifyVector = simplifyVector, simplifyDataFrame = simplifyDataFrame, 
         simplifyMatrix = simplifyMatrix, flatten = flatten, ...)
  20: parseJSON(txt, bigint_as_char)
  21: parse_string(txt, bigint_as_char)
  
  ── 9. Error: wm_records_date - works (@test-wm_records_date.R#8)  ──────────────
  (502) Bad Gateway - AphiaRecordsByDate
  1: wm_records_date(a_date) at testthat/test-wm_records_date.R:8
  2: wm_GET(file.path(wm_base(), "AphiaRecordsByDate"), query = cc(list(startdate = start_date, 
         enddate = end_date, marine_only = as_log(marine_only), offset = offset)), ...)
  3: on_error(sprintf("(%s) %s - %s", temp$status_code, temp$status_http()$message, basename(url)), 
         call. = FALSE)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 152 SKIPPED: 28 FAILED: 9
  1. Error: wm_children - offset parameter works (@test-wm_children.R#28) 
  2. Failure: wm_children_ - 'name' input works (@test-wm_children.R#69) 
  3. Failure: wm_children_ - 'name' input works (@test-wm_children.R#69) 
  4. Error: wm_classification_ works (@test-wm_classification.R#34) 
  5. Error: wm_external_ - default usage works (@test-wm_external.R#43) 
  6. Error: wm_name2id_ - default usage works (@test-wm_name2id.R#31) 
  7. Error: wm_record_ - default usage works (@test-wm_record.R#35) 
  8. Error: wm_record_by_external_ - default - by id type tsn (@test-wm_record_by_external.R#52) 
  9. Error: wm_records_date - works (@test-wm_records_date.R#8) 
  
  Error: testthat unit tests failed
  Execution halted