Running ‘testthat.R’ [2s/237s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(webTRISr)
  > 
  > testthat::test_check('webTRISr')
  ── 1. Error: WTares() returns dataframe (@test_WTareas.R#5)  ───────────────────
  $ operator is invalid for atomic vectors
  1: webtris_areas() at testthat/test_WTareas.R:5
  
  ── 2. Error: WTares(3) returns dataframe (@test_WTareas.R#16)  ─────────────────
  $ operator is invalid for atomic vectors
  1: webtris_areas(3) at testthat/test_WTareas.R:16
  
  ── 3. Error: webtris_quality() returns dataframe (@test_WTquality.R#5)  ────────
  $ operator is invalid for atomic vectors
  1: webtris_quality(siteID = "1", start_date = "01-01-2017", lubridate::dmy("07-01-2017"), 
         daily = TRUE) at testthat/test_WTquality.R:5
  
  ── 4. Error: webtris_quality(daily=FALSE) returns dataframe (@test_WTquality.R#1
  replacement has 0 rows, data has 1
  1: webtris_quality(siteID = c("1", "3"), start_date = "01-01-2017", lubridate::dmy("07-01-2017"), 
         daily = FALSE) at testthat/test_WTquality.R:14
  2: `$<-`(`*tmp*`, "data_quality", value = numeric(0))
  3: `$<-.data.frame`(`*tmp*`, "data_quality", value = numeric(0))
  4: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, nrows), domain = NA)
  
  ── 5. Error: webtris_quality(daily=FALSE) returns value 100 (@test_WTquality.R#2
  replacement has 0 rows, data has 1
  1: webtris_quality(siteID = "5688", start_date = "01012018", end_date = "03012018", 
         daily = FALSE) at testthat/test_WTquality.R:26
  2: `$<-`(`*tmp*`, "data_quality", value = numeric(0))
  3: `$<-.data.frame`(`*tmp*`, "data_quality", value = numeric(0))
  4: stop(sprintf(ngettext(N, "replacement has %d row, data has %d", "replacement has %d rows, data has %d"), 
         N, nrows), domain = NA)
  
  ── 6. Error: webtris_sites() returns dataframe (@test_WTsites.R#5)  ────────────
  $ operator is invalid for atomic vectors
  1: webtris_sites() at testthat/test_WTsites.R:5
  
  ── 7. Error: webtris_quality(daily=FALSE) returns dataframe (@test_WTsites.R#15)
  $ operator is invalid for atomic vectors
  1: webtris_sites(1) at testthat/test_WTsites.R:15
  
  ── 8. Failure: Daily report works (@test_reports.R#15)  ────────────────────────
  `expected_cols` not equivalent to colnames(x).
  Lengths differ: 24 is not 0
  
  ── 9. Error: This report should have 576 rows (@test_reports.R#24)  ────────────
  subscript out of bounds
  1: expect_length(x[[1]], 576) at testthat/test_reports.R:24
  2: quasi_label(enquo(object), arg = "object")
  3: eval_bare(get_expr(quo), get_env(quo))
  4: x[[1]]
  5: `[[.tbl_df`(x, 1)
  
  ── 10. Error: Report annual-totals works (@test_reports.R#29)  ─────────────────
  no applicable method for 'select_' applied to an object of class "NULL"
  1: webtris_report(sites = c("7", "26"), start_date = "01-01-2017", lubridate::dmy("07-01-2017"), 
         report_type = "monthly-daily") at testthat/test_reports.R:29
  2: eval(map_call)
  3: eval(map_call)
  4: purrr::map_df(.x = raw_data, .f = monthly_daily_flow_parser)
  5: map(.x, .f, ...)
  6: .f(.x[[i]], ...)
  7: response %>% httr::content(as = "text") %>% jsonlite::fromJSON() %>% purrr::pluck("MonthCollection") %>% 
         dplyr::select(c("Month", "SiteId", "Days"))
  8: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  9: eval(quote(`_fseq`(`_lhs`)), env, env)
  10: eval(quote(`_fseq`(`_lhs`)), env, env)
  11: `_fseq`(`_lhs`)
  12: freduce(value, `_function_list`)
  13: withVisible(function_list[[k]](value))
  14: function_list[[k]](value)
  15: dplyr::select(., c("Month", "SiteId", "Days"))
  16: select.default(., c("Month", "SiteId", "Days"))
  17: select_(.data, .dots = compat_as_lazy_dots(...))
  
  ── 11. Error: Report annual-monthly works (@test_reports.R#38)  ────────────────
  no applicable method for 'select_' applied to an object of class "NULL"
  1: webtris_report(sites = c("7", "26"), start_date = "01-01-2017", lubridate::dmy("07-01-2017"), 
         report_type = "annual-monthly") at testthat/test_reports.R:38
  2: eval(map_call)
  3: eval(map_call)
  4: purrr::map_df(.x = raw_data, .f = annual_monthly_parser)
  5: map(.x, .f, ...)
  6: .f(.x[[i]], ...)
  7: httr::content(response, as = "text") %>% jsonlite::fromJSON() %>% purrr::pluck("AnnualReportBody") %>% 
         dplyr::select(c("Year", "SiteId", "AnnualReportMonthlyDataRows"))
  8: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  9: eval(quote(`_fseq`(`_lhs`)), env, env)
  10: eval(quote(`_fseq`(`_lhs`)), env, env)
  11: `_fseq`(`_lhs`)
  12: freduce(value, `_function_list`)
  13: withVisible(function_list[[k]](value))
  14: function_list[[k]](value)
  15: dplyr::select(., c("Year", "SiteId", "AnnualReportMonthlyDataRows"))
  16: select.default(., c("Year", "SiteId", "AnnualReportMonthlyDataRows"))
  17: select_(.data, .dots = compat_as_lazy_dots(...))
  
  ── 12. Error: Report monthly-summary works (@test_reports.R#46)  ───────────────
  no applicable method for 'select_' applied to an object of class "NULL"
  1: webtris_report(sites = c("7", "26"), start_date = "01-01-2017", lubridate::dmy("07-01-2017"), 
         report_type = "monthly-summary") at testthat/test_reports.R:46
  2: eval(map_call)
  3: eval(map_call)
  4: purrr::map_df(.x = raw_data, .f = monthly_summary_aggregation_parser)
  5: map(.x, .f, ...)
  6: .f(.x[[i]], ...)
  7: httr::content(response, as = "text") %>% jsonlite::fromJSON() %>% purrr::pluck("MonthCollection") %>% 
         dplyr::select(c("Month", "SiteId", "Summary Aggregations")) %>% jsonlite::flatten()
  8: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  9: eval(quote(`_fseq`(`_lhs`)), env, env)
  10: eval(quote(`_fseq`(`_lhs`)), env, env)
  11: `_fseq`(`_lhs`)
  12: freduce(value, `_function_list`)
  13: function_list[[i]](value)
  14: dplyr::select(., c("Month", "SiteId", "Summary Aggregations"))
  15: select.default(., c("Month", "SiteId", "Summary Aggregations"))
  16: select_(.data, .dots = compat_as_lazy_dots(...))
  
  ── 13. Error: Report monthly-daily works (@test_reports.R#54)  ─────────────────
  no applicable method for 'select_' applied to an object of class "NULL"
  1: webtris_report(sites = c("7", "26"), start_date = "01-01-2017", lubridate::dmy("07-01-2017"), 
         report_type = "monthly-daily") at testthat/test_reports.R:54
  2: eval(map_call)
  3: eval(map_call)
  4: purrr::map_df(.x = raw_data, .f = monthly_daily_flow_parser)
  5: map(.x, .f, ...)
  6: .f(.x[[i]], ...)
  7: response %>% httr::content(as = "text") %>% jsonlite::fromJSON() %>% purrr::pluck("MonthCollection") %>% 
         dplyr::select(c("Month", "SiteId", "Days"))
  8: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  9: eval(quote(`_fseq`(`_lhs`)), env, env)
  10: eval(quote(`_fseq`(`_lhs`)), env, env)
  11: `_fseq`(`_lhs`)
  12: freduce(value, `_function_list`)
  13: withVisible(function_list[[k]](value))
  14: function_list[[k]](value)
  15: dplyr::select(., c("Month", "SiteId", "Days"))
  16: select.default(., c("Month", "SiteId", "Days"))
  17: select_(.data, .dots = compat_as_lazy_dots(...))
  
  ── 14. Error: Report monthly-daily-aggregate works (@test_reports.R#62)  ───────
  no applicable method for 'select_' applied to an object of class "NULL"
  1: webtris_report(sites = c("7", "26"), start_date = "01-01-2017", lubridate::dmy("07-01-2017"), 
         report_type = "monthly-daily-aggregate") at testthat/test_reports.R:62
  2: eval(map_call)
  3: eval(map_call)
  4: purrr::map_df(.x = raw_data, .f = monthly_daily_aggregate_parser)
  5: map(.x, .f, ...)
  6: .f(.x[[i]], ...)
  7: response %>% httr::content(as = "text") %>% jsonlite::fromJSON() %>% purrr::pluck("MonthCollection") %>% 
         dplyr::select(c("Month", "SiteId", "Daily Aggregations"))
  8: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  9: eval(quote(`_fseq`(`_lhs`)), env, env)
  10: eval(quote(`_fseq`(`_lhs`)), env, env)
  11: `_fseq`(`_lhs`)
  12: freduce(value, `_function_list`)
  13: withVisible(function_list[[k]](value))
  14: function_list[[k]](value)
  15: dplyr::select(., c("Month", "SiteId", "Daily Aggregations"))
  16: select.default(., c("Month", "SiteId", "Daily Aggregations"))
  17: select_(.data, .dots = compat_as_lazy_dots(...))
  
  ── 15. Error: Report monthly-hourly-aggregate works (@test_reports.R#70)  ──────
  no applicable method for 'select_' applied to an object of class "NULL"
  1: webtris_report(sites = c("7", "26"), start_date = "01-01-2017", lubridate::dmy("07-01-2017"), 
         report_type = "monthly-hourly-aggregate") at testthat/test_reports.R:70
  2: eval(map_call)
  3: eval(map_call)
  4: purrr::map_df(.x = raw_data, .f = monthly_hourly_aggregate_parser)
  5: map(.x, .f, ...)
  6: .f(.x[[i]], ...)
  7: response %>% httr::content(as = "text") %>% jsonlite::fromJSON() %>% purrr::pluck("MonthCollection") %>% 
         dplyr::select(c("Month", "SiteId", "Hourly Aggregations"))
  8: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  9: eval(quote(`_fseq`(`_lhs`)), env, env)
  10: eval(quote(`_fseq`(`_lhs`)), env, env)
  11: `_fseq`(`_lhs`)
  12: freduce(value, `_function_list`)
  13: withVisible(function_list[[k]](value))
  14: function_list[[k]](value)
  15: dplyr::select(., c("Month", "SiteId", "Hourly Aggregations"))
  16: select.default(., c("Month", "SiteId", "Hourly Aggregations"))
  17: select_(.data, .dots = compat_as_lazy_dots(...))
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 1 SKIPPED: 0 WARNINGS: 0 FAILED: 15
  1. Error: WTares() returns dataframe (@test_WTareas.R#5) 
  2. Error: WTares(3) returns dataframe (@test_WTareas.R#16) 
  3. Error: webtris_quality() returns dataframe (@test_WTquality.R#5) 
  4. Error: webtris_quality(daily=FALSE) returns dataframe (@test_WTquality.R#14) 
  5. Error: webtris_quality(daily=FALSE) returns value 100 (@test_WTquality.R#26) 
  6. Error: webtris_sites() returns dataframe (@test_WTsites.R#5) 
  7. Error: webtris_quality(daily=FALSE) returns dataframe (@test_WTsites.R#15) 
  8. Failure: Daily report works (@test_reports.R#15) 
  9. Error: This report should have 576 rows (@test_reports.R#24) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted