Running 'test-all.R' [179s]
Running the tests in 'tests/test-all.R' failed.
Complete output:
  > 
  > library(testthat)
  > 
  > # important to replicate errors!
  > rclimateca::clear_cache()
  > 
  > test_check("rclimateca")
  Loading required package: rclimateca
  -- 1. Error: the cache can be cleared (@test-caches.R#10)  ---------------------
  The following errors occurred while downloading/parsing climate data: Download failed
  1: ec_climate_data(27141, timeframe = "monthly", cache = temp_cache) at testthat/test-caches.R:10
  2: stop("The following errors occurred while downloading/parsing climate data: ", paste(errors, 
         collapse = ", "))
  
  -- 2. Error: ec_climate_data_base works as intended (@test-climate_data.R#5)  --
  Unable to connect to http://climate.weather.gc.ca/climate_data/bulk_data_e.html?format=csv&stationID=27141&submit=Download%20Data&timeframe=3: 
    Timeout was reached: Connection timed out after 10015 milliseconds
  1: ec_climate_data_base(27141, timeframe = "monthly") at testthat/test-climate_data.R:5
  2: restquery(endpoint, .encoding = "UTF-8", format = "csv", stationID = as.numeric(location), 
         submit = "Download Data", timeframe = which(timeframe == c("hourly", "daily", 
             "monthly")), Year = year, Month = month, .cache = cache, .quiet = quiet)
  3: stop("Unable to connect to ", url_string, ": ", as.character(connect))
  
  -- 3. Error: ec_climate_data works as intended (@test-climate_data.R#25)  ------
  The following errors occurred while downloading/parsing climate data: Download failed
  1: ec_climate_data(27141, timeframe = "daily", start = "1999-01-01", end = "1999-12-31") at testthat/test-climate_data.R:25
  2: stop("The following errors occurred while downloading/parsing climate data: ", paste(errors, 
         collapse = ", "))
  
  -- 4. Error: column types for ec_climate_data() are correct (@test-climate_data.
  The following errors occurred while downloading/parsing climate data: Download failed
  1: ec_climate_data(27141, timeframe = "daily", start = "1999-01-01", end = "1999-12-31") at testthat/test-climate_data.R:44
  2: stop("The following errors occurred while downloading/parsing climate data: ", paste(errors, 
         collapse = ", "))
  
  -- 5. Error: dates and times are parsed correctly (@test-climate_data.R#129)  --
  The following errors occurred while downloading/parsing climate data: Download failed
  1: ec_climate_data(27141, timeframe = "daily", start = "1999-01-01", end = "1999-12-31") at testthat/test-climate_data.R:129
  2: stop("The following errors occurred while downloading/parsing climate data: ", paste(errors, 
         collapse = ", "))
  
  -- 6. Error: times are parsed correctly for multiple locations (@test-climate_da
  The following errors occurred while downloading/parsing climate data: Download failed
  1: expect_silent(ec_climate_data(27141, timeframe = "hourly", start = "1999-07-01", 
         end = "1999-07-31")) at testthat/test-climate_data.R:186
  2: quasi_capture(enquo(object), NULL, evaluate_promise)
  3: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)), ...)
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(.quo), get_env(.quo))
  9: ec_climate_data(27141, timeframe = "hourly", start = "1999-07-01", end = "1999-07-31")
  10: stop("The following errors occurred while downloading/parsing climate data: ", paste(errors, 
         collapse = ", "))
  
  -- 7. Error: date filtering is respected (@test-climate_data.R#227)  -----------
  The following errors occurred while downloading/parsing climate data: Download failed
  1: ec_climate_data(27141, timeframe = "daily", start = start, end = end) at testthat/test-climate_data.R:227
  2: stop("The following errors occurred while downloading/parsing climate data: ", paste(errors, 
         collapse = ", "))
  
  -- 8. Error: no files are downloaded when the locations table indicates there is
  The following errors occurred while downloading/parsing climate data: Download failed
  1: ec_climate_data(27141, timeframe = "daily", start = "1995-01-01", end = "1996-01-31", 
         cache = temp_cache) at testthat/test-climate_data.R:290
  2: stop("The following errors occurred while downloading/parsing climate data: ", paste(errors, 
         collapse = ", "))
  
  -- 9. Error: parsing errors result in a warning and a problems attribute (@test-
  The following errors occurred while downloading/parsing climate data: Download failed
  1: expect_silent(ec_climate_data("CHELSEA QC 5585", timeframe = "daily", start = "2015-11-01", 
         end = "2015-11-30")) at testthat/test-climate_data.R:324
  2: quasi_capture(enquo(object), NULL, evaluate_promise)
  3: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)), ...)
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(.quo), get_env(.quo))
  9: ec_climate_data("CHELSEA QC 5585", timeframe = "daily", start = "2015-11-01", end = "2015-11-30")
  10: stop("The following errors occurred while downloading/parsing climate data: ", paste(errors, 
         collapse = ", "))
  
  -- 10. Error: parse as character works (@test-climate_data.R#355)  -------------
  The following errors occurred while downloading/parsing climate data: Download failed
  1: expect_silent(ec_climate_data("KENTVILLE CDA CS NS 27141", timeframe = "daily", start = "2015-11-01", 
         end = "2015-11-30", value_parser = readr::parse_character)) at testthat/test-climate_data.R:355
  2: quasi_capture(enquo(object), NULL, evaluate_promise)
  3: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)), ...)
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(.quo), get_env(.quo))
  9: ec_climate_data("KENTVILLE CDA CS NS 27141", timeframe = "daily", start = "2015-11-01", 
         end = "2015-11-30", value_parser = readr::parse_character)
  10: stop("The following errors occurred while downloading/parsing climate data: ", paste(errors, 
         collapse = ", "))
  
  -- 11. Error: the quiet flag is respected (@test-climate_data.R#376)  ----------
  The following errors occurred while downloading/parsing climate data: Download failed
  1: expect_silent(ec_climate_data(27141, timeframe = "daily", start = "1996-01-01", end = "1996-12-31")) at testthat/test-climate_data.R:376
  2: quasi_capture(enquo(object), NULL, evaluate_promise)
  3: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)), ...)
  4: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  5: force(code)
  6: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  7: withVisible(code)
  8: eval_bare(get_expr(.quo), get_env(.quo))
  9: ec_climate_data(27141, timeframe = "daily", start = "1996-01-01", end = "1996-12-31")
  10: stop("The following errors occurred while downloading/parsing climate data: ", paste(errors, 
         collapse = ", "))
  
  -- 12. Error: the cache flag is respected (@test-climate_data.R#403)  ----------
  The following errors occurred while downloading/parsing climate data: Download failed
  1: ec_climate_data(27141, timeframe = "daily", start = "1996-01-01", end = "1996-12-31", 
         cache = temp_cache) at testthat/test-climate_data.R:403
  2: stop("The following errors occurred while downloading/parsing climate data: ", paste(errors, 
         collapse = ", "))
  
  -- 13. Error: ec_climate_long correctly transforms output (@test-climate_data.R#
  The following errors occurred while downloading/parsing climate data: Download failed
  1: ec_climate_data(27141, timeframe = "daily", start = "1999-01-01", end = "1999-12-31") at testthat/test-climate_data.R:419
  2: stop("The following errors occurred while downloading/parsing climate data: ", paste(errors, 
         collapse = ", "))
  
  -- 14. Error: get mudata function for climate data works (@test-climate_data.R#4
  The following errors occurred while downloading/parsing climate data: Download failed
  1: ec_climate_mudata(27141, timeframe = "daily", start = "1999-01-01", end = "1999-12-31") at testthat/test-climate_data.R:446
  2: ec_climate_data(location = location, timeframe = timeframe, start = start, end = end, 
         cache = cache, quiet = quiet)
  3: stop("The following errors occurred while downloading/parsing climate data: ", paste(errors, 
         collapse = ", "))
  
  -- 15. Error: ec_climate_data_read_csv works on downloaded files (@test-climate_
  Timeout was reached: Connection timed out after 10015 milliseconds
  1: curl::curl_download(url, temp_dst) at testthat/test-climate_data.R:498
  
  -- 16. Error: all timeframes and output types of data work for a random location
  Daily data for site PATERSON (1144) failed (years 1954-1963): Download failed for args stationID=1144/Year=1954/Month=NA/timeframe=daily/.cache=ec.cache/.quiet=TRUE: 
    Download failed
  
  1: expect_true(test_locations(id = 1144)) at testthat/test-deprecated_functions.R:88
  2: quasi_label(enquo(object), label, arg = "object")
  3: eval_bare(get_expr(quo), get_env(quo))
  4: test_locations(id = 1144)
  5: tryCatch({
         dfwide <- suppressMessages(getClimateData(site$stationid, timeframe = "daily", 
             year = yearstart:yearend, progress = "none"))
         dflong <- suppressMessages(getClimateData(site$stationid, timeframe = "daily", 
             year = yearstart:yearend, format = "long", progress = "none"))
         md <- suppressMessages(getClimateMUData(site$stationid, timeframe = "daily", 
             year = yearstart:yearend, progress = "none"))
     }, error = function(err) {
         msg <- sprintf("Daily data for site %s (%s) failed (years %s-%s): %s", site$name, 
             site$stationid, yearstart, yearend, err)
         message(msg)
         error_action(msg)
     }) at testthat/test-deprecated_functions.R:37
  6: tryCatchList(expr, classes, parentenv, handlers)
  7: tryCatchOne(expr, names, parentenv, handlers[[1L]])
  8: value[[3L]](cond)
  9: error_action(msg) at testthat/test-deprecated_functions.R:53
  
  -- 17. Error: deprecated functions all have a warning (@test-deprecated_function
  Download failed for args stationID=27141/Year=2014/Month=NA/timeframe=daily/.cache=ec.cache/.quiet=TRUE: 
    Download failed
  1: expect_message(getClimateData(27141, timeframe = "daily", year = 2014:2016, progress = "none"), 
         "is deprecated and will be removed in future versions") at testthat/test-deprecated_functions.R:96
  2: quasi_capture(enquo(object), label, capture_messages)
  3: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)), ...)
  4: withCallingHandlers(code, message = function(condition) {
         out$push(condition)
         invokeRestart("muffleMessage")
     })
  5: eval_bare(get_expr(.quo), get_env(.quo))
  6: getClimateData(27141, timeframe = "daily", year = 2014:2016, progress = "none")
  7: ply(.data = args, .margins = 1, .fun = function(row) {
         if (checkdates) {
             yrs <- getyears(row$stationID, timeframe)
             if (!is.na(row$Year) && !(row$Year %in% yrs)) {
                 return(data.frame())
             }
         }
         row <- as.list(row)
         row$timeframe <- timeframe
         if (is.null(cache)) {
             row[".cache"] <- list(NULL)
         }
         else {
             row$.cache <- cache
         }
         row$.quiet <- quiet
         res <- try(do.call(getClimateDataRaw, row), silent = TRUE)
         if (class(res) == "try-error") {
             stop("Download failed for args ", paste(names(row), unlist(row, use.names = F), 
                 sep = "=", collapse = "/"), ": ", res)
         }
         if (parsedates) {
             res <- parsedates(res, timeframe)
         }
         if (checkdates) {
             filter <- rep(TRUE, nrow(res))
             if (!is.null(year)) {
                 filter <- filter & res$Year %in% year
             }
             if (!is.null(month)) {
                 filter <- filter & res$Month %in% month
             }
             if (!is.null(day)) {
                 filter <- filter & res$Day %in% day
             }
             res <- res[filter, ]
         }
         if (format == "long") {
             res <- climatelong(res, rm.na = rm.na)
         }
         return(res)
     }, .progress = progress)
  8: ldply(.data = pieces, .fun = .fun, ..., .progress = .progress, .inform = .inform, 
         .parallel = .parallel, .paropts = .paropts, .id = .id)
  9: llply(.data = .data, .fun = .fun, ..., .progress = .progress, .inform = .inform, 
         .parallel = .parallel, .paropts = .paropts)
  10: loop_apply(n, do.ply)
  11: (function (i) 
     {
         piece <- pieces[[i]]
         if (.inform) {
             res <- try(.fun(piece, ...))
             if (inherits(res, "try-error")) {
                 piece <- paste(utils::capture.output(print(piece)), collapse = "\n")
                 stop("with piece ", i, ": \n", piece, call. = FALSE)
             }
         }
         else {
             res <- .fun(piece, ...)
         }
         progress$step()
         res
     })(1L)
  12: .fun(piece, ...)
  13: stop("Download failed for args ", paste(names(row), unlist(row, use.names = F), sep = "=", 
         collapse = "/"), ": ", res)
  
  == testthat results  ===========================================================
  OK: 95 SKIPPED: 0 WARNINGS: 1 FAILED: 17
  1. Error: the cache can be cleared (@test-caches.R#10) 
  2. Error: ec_climate_data_base works as intended (@test-climate_data.R#5) 
  3. Error: ec_climate_data works as intended (@test-climate_data.R#25) 
  4. Error: column types for ec_climate_data() are correct (@test-climate_data.R#44) 
  5. Error: dates and times are parsed correctly (@test-climate_data.R#129) 
  6. Error: times are parsed correctly for multiple locations (@test-climate_data.R#186) 
  7. Error: date filtering is respected (@test-climate_data.R#227) 
  8. Error: no files are downloaded when the locations table indicates there is no data (@test-climate_data.R#290) 
  9. Error: parsing errors result in a warning and a problems attribute (@test-climate_data.R#324) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted