Running ‘testthat.R’ [2s/11s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(crimedata)
  > 
  > test_check("crimedata")
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error (test_file_urls.R:4:3): return value of get_file_urls is a tibble ─────
  Error: Bad Gateway (HTTP 502).
  Backtrace:
       █
    1. ├─testthat::expect_is(get_file_urls(), "tbl_df") test_file_urls.R:4:2
    2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
    3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
    4. ├─crimedata:::get_file_urls()
    5. │ └─crimedata:::fetch_file_urls()
    6. │   └─`%>%`(...)
    7. ├─httr::content(., as = "parsed", type = "application/json")
    8. │ ├─base::stopifnot(is.response(x))
    9. │ └─httr:::is.response(x)
   10. └─httr::stop_for_status(.)
  ── Error (test_file_urls.R:8:3): type column of return value contains only valid values ──
  Error: Bad Gateway (HTTP 502).
  Backtrace:
       █
    1. ├─testthat::expect_is(get_file_urls()[["data_type"]], "character") test_file_urls.R:8:2
    2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
    3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
    4. ├─crimedata:::get_file_urls()
    5. │ └─crimedata:::fetch_file_urls()
    6. │   └─`%>%`(...)
    7. ├─httr::content(., as = "parsed", type = "application/json")
    8. │ ├─base::stopifnot(is.response(x))
    9. │ └─httr:::is.response(x)
   10. └─httr::stop_for_status(.)
  ── Error (test_file_urls.R:13:3): year column of return value contains only valid integer years ──
  Error: Bad Gateway (HTTP 502).
  Backtrace:
       █
    1. ├─testthat::expect_is(get_file_urls()[["year"]], "integer") test_file_urls.R:13:2
    2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
    3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
    4. ├─crimedata:::get_file_urls()
    5. │ └─crimedata:::fetch_file_urls()
    6. │   └─`%>%`(...)
    7. ├─httr::content(., as = "parsed", type = "application/json")
    8. │ ├─base::stopifnot(is.response(x))
    9. │ └─httr:::is.response(x)
   10. └─httr::stop_for_status(.)
  ── Error (test_file_urls.R:20:3): file_url column of return value contains only URLs ──
  Error: Bad Gateway (HTTP 502).
  Backtrace:
       █
    1. ├─testthat::expect_is(get_file_urls()[["file_url"]], "character") test_file_urls.R:20:2
    2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
    3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
    4. ├─crimedata:::get_file_urls()
    5. │ └─crimedata:::fetch_file_urls()
    6. │   └─`%>%`(...)
    7. ├─httr::content(., as = "parsed", type = "application/json")
    8. │ ├─base::stopifnot(is.response(x))
    9. │ └─httr:::is.response(x)
   10. └─httr::stop_for_status(.)
  ── Error (test_file_urls.R:25:3): return value of list_crime_data is a tibble ──
  Error: Bad Gateway (HTTP 502).
  Backtrace:
       █
    1. ├─testthat::expect_is(list_crime_data(), "tbl_df") test_file_urls.R:25:2
    2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
    3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
    4. ├─crimedata::list_crime_data()
    5. │ ├─`%>%`(...)
    6. │ └─crimedata:::get_file_urls(quiet = quiet)
    7. │   └─crimedata:::fetch_file_urls()
    8. │     └─`%>%`(...)
    9. ├─dplyr::select(., .data$city, .data$years)
   10. ├─dplyr::mutate(., years = paste(.data$year_min, "to", .data$year_max))
   11. ├─dplyr::summarise(., year_min = min(.data$year), year_max = max(.data$year))
   12. ├─dplyr::group_by(., .data$city)
   13. ├─httr::content(., as = "parsed", type = "application/json")
   14. │ ├─base::stopifnot(is.response(x))
   15. │ └─httr:::is.response(x)
   16. └─httr::stop_for_status(.)
  ── Error (test_get_crime_data.R:4:3): return value of get_crime_data is a tibble or SF object ──
  Error: Bad Gateway (HTTP 502).
  Backtrace:
       █
    1. ├─testthat::expect_is(get_crime_data(), "tbl_df") test_get_crime_data.R:4:2
    2. │ └─testthat::quasi_label(enquo(object), label, arg = "object")
    3. │   └─rlang::eval_bare(expr, quo_get_env(quo))
    4. ├─crimedata::get_crime_data()
    5. │ └─crimedata:::get_file_urls(quiet = quiet)
    6. │   └─crimedata:::fetch_file_urls()
    7. │     └─`%>%`(...)
    8. ├─httr::content(., as = "parsed", type = "application/json")
    9. │ ├─base::stopifnot(is.response(x))
   10. │ └─httr:::is.response(x)
   11. └─httr::stop_for_status(.)
  ── Failure (test_get_crime_data.R:9:3): incorrect arguments produce errors ─────
  `get_crime_data(years = 1990:1995)` threw an error with unexpected message.
  Expected match: "One or more of the specified years"
  Actual message: "Bad Gateway (HTTP 502)."
  Backtrace:
       █
    1. ├─testthat::expect_error(get_crime_data(years = 1990:1995), "One or more of the specified years") test_get_crime_data.R:9:2
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat:::.capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. ├─crimedata::get_crime_data(years = 1990:1995)
    7. │ └─crimedata:::get_file_urls(quiet = quiet)
    8. │   └─crimedata:::fetch_file_urls()
    9. │     └─`%>%`(...)
   10. ├─httr::content(., as = "parsed", type = "application/json")
   11. │ ├─base::stopifnot(is.response(x))
   12. │ └─httr:::is.response(x)
   13. └─httr::stop_for_status(.)
  ── Failure (test_get_crime_data.R:11:3): incorrect arguments produce errors ────
  `get_crime_data(cities = c("non-existant city"))` threw an error with unexpected message.
  Expected match: "One or more of the specified cities"
  Actual message: "Bad Gateway (HTTP 502)."
  Backtrace:
       █
    1. ├─testthat::expect_error(...) test_get_crime_data.R:11:2
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat:::.capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. ├─crimedata::get_crime_data(cities = c("non-existant city"))
    7. │ └─crimedata:::get_file_urls(quiet = quiet)
    8. │   └─crimedata:::fetch_file_urls()
    9. │     └─`%>%`(...)
   10. ├─httr::content(., as = "parsed", type = "application/json")
   11. │ ├─base::stopifnot(is.response(x))
   12. │ └─httr:::is.response(x)
   13. └─httr::stop_for_status(.)
  ── Failure (test_get_crime_data.R:14:3): incorrect arguments produce errors ────
  `get_crime_data(cities = "Virginia Beach", years = 2007)` threw an error with unexpected message.
  Expected match: "The Crime Open Database does not contain data for any"
  Actual message: "Bad Gateway (HTTP 502)."
  Backtrace:
       █
    1. ├─testthat::expect_error(...) test_get_crime_data.R:14:2
    2. │ └─testthat:::quasi_capture(...)
    3. │   ├─testthat:::.capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. ├─crimedata::get_crime_data(cities = "Virginia Beach", years = 2007)
    7. │ └─crimedata:::get_file_urls(quiet = quiet)
    8. │   └─crimedata:::fetch_file_urls()
    9. │     └─`%>%`(...)
   10. ├─httr::content(., as = "parsed", type = "application/json")
   11. │ ├─base::stopifnot(is.response(x))
   12. │ └─httr:::is.response(x)
   13. └─httr::stop_for_status(.)
  ── Error (test_get_crime_data.R:21:3): partially missing data produce warnings ──
  Error: Bad Gateway (HTTP 502).
  Backtrace:
       █
    1. ├─testthat::expect_warning(...) test_get_crime_data.R:21:2
    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. ├─crimedata::get_crime_data(cities = "Virginia Beach", years = 2012:2013)
    7. │ └─crimedata:::get_file_urls(quiet = quiet)
    8. │   └─crimedata:::fetch_file_urls()
    9. │     └─`%>%`(...)
   10. ├─httr::content(., as = "parsed", type = "application/json")
   11. │ ├─base::stopifnot(is.response(x))
   12. │ └─httr:::is.response(x)
   13. └─httr::stop_for_status(.)
  ── Error (test_get_crime_data.R:28:3): quiet execution does not return any messages ──
  Error: Bad Gateway (HTTP 502).
  Backtrace:
       █
    1. ├─testthat::expect_message(get_crime_data(quiet = TRUE), NA) test_get_crime_data.R:28:2
    2. │ └─testthat:::quasi_capture(enquo(object), label, capture_messages)
    3. │   ├─testthat:::.capture(...)
    4. │   │ └─base::withCallingHandlers(...)
    5. │   └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    6. ├─crimedata::get_crime_data(quiet = TRUE)
    7. │ └─crimedata:::get_file_urls(quiet = quiet)
    8. │   └─crimedata:::fetch_file_urls()
    9. │     └─`%>%`(...)
   10. ├─httr::content(., as = "parsed", type = "application/json")
   11. │ ├─base::stopifnot(is.response(x))
   12. │ └─httr:::is.response(x)
   13. └─httr::stop_for_status(.)
  ── Error (test_get_crime_data.R:34:3): data cache works as expected ────────────
  Error: Bad Gateway (HTTP 502).
  Backtrace:
      █
   1. ├─crimedata::get_crime_data(cities = "Detroit") test_get_crime_data.R:34:2
   2. │ └─crimedata:::get_file_urls(quiet = quiet)
   3. │   └─crimedata:::fetch_file_urls()
   4. │     └─`%>%`(...)
   5. ├─httr::content(., as = "parsed", type = "application/json")
   6. │ ├─base::stopifnot(is.response(x))
   7. │ └─httr:::is.response(x)
   8. └─httr::stop_for_status(.)
  
  [ FAIL 12 | WARN 0 | SKIP 0 | PASS 17 ]
  Error: Test failures
  Execution halted