Running 'testthat.R' [90s/193s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(weathercan)
  > 
  > Sys.setenv("R_TESTS" = "")
  > 
  > test_check("weathercan")
  -- 1. Error: stations_normals() gets normals info (@test_03_station_dl.R#6)  ---
  server certificate verification failed. CAfile: none CRLfile: none
  1: expect_silent(n <- stations_normals(years = "1981-2010")) %>% expect_is("character") at testthat/test_03_station_dl.R:6
  2: eval(lhs, parent, parent)
  3: eval(lhs, parent, parent)
  4: expect_silent(n <- stations_normals(years = "1981-2010"))
  5: quasi_capture(enquo(object), NULL, evaluate_promise)
  6: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)), ...)
  7: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  8: force(code)
  9: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  10: withVisible(code)
  ...
  28: eval(lhs, parent, parent)
  29: xml2::read_html(loc)
  30: read_html.default(loc)
  31: suppressWarnings(read_xml(x, encoding = encoding, ..., as_html = TRUE, options = options))
  32: withCallingHandlers(expr, warning = function(w) invokeRestart("muffleWarning"))
  33: read_xml(x, encoding = encoding, ..., as_html = TRUE, options = options)
  34: read_xml.character(x, encoding = encoding, ..., as_html = TRUE, options = options)
  35: read_xml.connection(con, encoding = encoding, ..., as_html = as_html, base_url = x, 
         options = options)
  36: open(x, "rb")
  37: open.connection(x, "rb")
  
  -- 2. Error: normals_url() correctly creates urls (@test_08_normals.R#4)  ------
  no applicable method for 'status_code' applied to an object of class "character"
  1: expect_equal(normals_url(prov = "MB", climate_id = c("5010480", "5010480"), normals_years = "1981-2010"), 
         paste0("https://dd.meteo.gc.ca/climate/observations/normals/csv/1981-2010/", 
             "MB/climate_normals_MB_", c("5010480", "5010480"), "_1981-2010.csv")) at testthat/test_08_normals.R:4
  2: quasi_label(enquo(object), label, arg = "object")
  3: eval_bare(get_expr(quo), get_env(quo))
  4: normals_url(prov = "MB", climate_id = c("5010480", "5010480"), normals_years = "1981-2010")
  5: check_url(getOption("weathercan.urls.normals"))
  6: httr::stop_for_status(h)
  7: status_code(x)
  
  -- 3. Error: normals_extract() / frost_extract() extract data (@test_08_normals.
  cannot open the connection to 'https://dd.meteo.gc.ca/climate/observations/normals/csv/1981-2010/MB/climate_normals_MB_5010480_1981-2010.csv'
  1: paste0("https://dd.meteo.gc.ca/climate/observations/normals/csv/", "1981-2010/MB/climate_normals_MB_5010480_1981-2010.csv") %>% 
         normals_raw() at testthat/test_08_normals.R:26
  2: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  3: eval(quote(`_fseq`(`_lhs`)), env, env)
  4: eval(quote(`_fseq`(`_lhs`)), env, env)
  5: `_fseq`(`_lhs`)
  6: freduce(value, `_function_list`)
  7: withVisible(function_list[[k]](value))
  8: function_list[[k]](value)
  9: normals_raw(.)
  10: readLines(con <- url(loc, encoding = "latin1"), n = nrows)
  
  -- 4. Error: normals_format()/frost_format() format data to correct class (@test
  server certificate verification failed. CAfile: none CRLfile: none
  1: paste0("https://dd.meteo.gc.ca/climate/observations/normals/csv/", "1981-2010/MB/climate_normals_MB_5010480_1981-2010.csv") %>% 
         normals_raw() at testthat/test_08_normals.R:36
  2: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  3: eval(quote(`_fseq`(`_lhs`)), env, env)
  4: eval(quote(`_fseq`(`_lhs`)), env, env)
  5: `_fseq`(`_lhs`)
  6: freduce(value, `_function_list`)
  7: withVisible(function_list[[k]](value))
  8: function_list[[k]](value)
  9: normals_raw(.)
  10: httr::GET(loc)
  11: request_perform(req, hu$handle$handle)
  12: request_fetch(req$output, req$url, handle)
  13: request_fetch.write_memory(req$output, req$url, handle)
  14: curl::curl_fetch_memory(url, handle = handle)
  
  -- 5. Error: normals_dl() downloads normals/frost dates as tibble (@test_08_norm
  server certificate verification failed. CAfile: none CRLfile: none
  1: expect_silent(normals_dl(climate_id = "5010480")) %>% expect_is("tbl_df") at testthat/test_08_normals.R:57
  2: eval(lhs, parent, parent)
  3: eval(lhs, parent, parent)
  4: expect_silent(normals_dl(climate_id = "5010480"))
  5: quasi_capture(enquo(object), NULL, evaluate_promise)
  6: .capture(act$val <- eval_bare(get_expr(.quo), get_env(.quo)), ...)
  7: withr::with_output_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  8: force(code)
  9: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  10: withVisible(code)
  ...
  16: dplyr::mutate(n, loc = normals_url(.data$prov, .data$climate_id, normals_years))
  17: mutate.tbl_df(n, loc = normals_url(.data$prov, .data$climate_id, normals_years))
  18: mutate_impl(.data, dots, caller_env())
  19: normals_url(.data$prov, .data$climate_id, normals_years)
  20: httr::http_error(httr::GET(loc))
  21: httr::GET(loc)
  22: request_perform(req, hu$handle$handle)
  23: request_fetch(req$output, req$url, handle)
  24: request_fetch.write_memory(req$output, req$url, handle)
  25: curl::curl_fetch_memory(url, handle = handle)
  
  == testthat results  ===========================================================
  [ OK: 538 | SKIPPED: 5 | WARNINGS: 1 | FAILED: 5 ]
  1. Error: stations_normals() gets normals info (@test_03_station_dl.R#6) 
  2. Error: normals_url() correctly creates urls (@test_08_normals.R#4) 
  3. Error: normals_extract() / frost_extract() extract data (@test_08_normals.R#26) 
  4. Error: normals_format()/frost_format() format data to correct class (@test_08_normals.R#36) 
  5. Error: normals_dl() downloads normals/frost dates as tibble (@test_08_normals.R#57) 
  
  Error: testthat unit tests failed
  In addition: Warning message:
  In for (i in seq_len(n)) { :
    closing unused connection 5 (https://dd.meteo.gc.ca/climate/observations/normals/csv/1981-2010/MB)
  Execution halted