Running 'testthat.R' [9s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library("testthat")
  > library("rdefra")
  > 
  > test_check("rdefra")
  -- 1. Error: Hourly data for station ABD/2014 should be available (@test-data.R#
  SSL certificate problem: unable to get local issuer certificate
  1: expect_that(httr::http_error(myURL), equals(FALSE)) at testthat/test-data.R:11
  2: condition(object)
  3: expect_equal(x, expected, ..., expected.label = label)
  4: quasi_label(enquo(object), label)
  5: eval_bare(get_expr(quo), get_env(quo))
  6: httr::http_error(myURL)
  7: http_error.character(myURL)
  8: http_error(HEAD(x, ...))
  9: HEAD(x, ...)
  10: request_perform(req, hu$handle$handle)
  11: request_fetch(req$output, req$url, handle)
  12: request_fetch.write_memory(req$output, req$url, handle)
  13: curl::curl_fetch_memory(url, handle = handle)
  
  Error in file(file, "rt") : cannot open the connection
  Error in file(file, "rt") : cannot open the connection
  Error in file(file, "rt") : cannot open the connection
  Error in file(file, "rt") : cannot open the connection
  Error in file(file, "rt") : cannot open the connection
  Error in file(file, "rt") : cannot open the connection
  Error in file(file, "rt") : cannot open the connection
  Error in file(file, "rt") : cannot open the connection
  Error in file(file, "rt") : cannot open the connection
  Error in file(file, "rt") : cannot open the connection
  Error in file(file, "rt") : cannot open the connection
  Error in file(file, "rt") : cannot open the connection
  Error in file(file, "rt") : cannot open the connection
  Error in file(file, "rt") : cannot open the connection
  Error in file(file, "rt") : cannot open the connection
  -- 2. Failure: Metadata should be in the right format (@test-data.R#44)  -------
  `x` not equal to `expected`.
  1 element mismatch
  
  Error in file(file, "rt") : cannot open the connection
  -- 3. Failure: Data should be in the right format (@test-data.R#55)  -----------
  `x` not equal to `expected`.
  'is.NA' value mismatch: 0 in current 1 in target
  
  -- 4. Error: DEFRA server should be running (@test-metadata.R#13)  -------------
  SSL certificate problem: unable to get local issuer certificate
  1: httr::GET(url = "http://uk-air.defra.gov.uk", path = "networks/find-sites", query = list(site_name = site_name, 
         pollutant = pollutant, group_id = group_id, closed = closed, country_id = country_id, 
         region_id = region_id, location_type = location_type, search = "Search+Network", 
         view = "advanced", action = "results")) at testthat/test-metadata.R:13
  2: request_perform(req, hu$handle$handle)
  3: request_fetch(req$output, req$url, handle)
  4: request_fetch.write_memory(req$output, req$url, handle)
  5: curl::curl_fetch_memory(url, handle = handle)
  
  -- 5. Error: Up-to-date metadata catalogue should have at least 6569 stations. (
  SSL certificate problem: unable to get local issuer certificate
  1: ukair_catalogue() at testthat/test-metadata.R:37
  2: httr::GET(url = "http://uk-air.defra.gov.uk", path = "networks/find-sites", query = list(site_name = site_name, 
         pollutant = pollutant, group_id = group_id, closed = closed, country_id = country_id, 
         region_id = region_id, location_type = 9999, search = "Search+Network", view = "advanced", 
         action = "results"))
  3: request_perform(req, hu$handle$handle)
  4: request_fetch(req$output, req$url, handle)
  5: request_fetch.write_memory(req$output, req$url, handle)
  6: curl::curl_fetch_memory(url, handle = handle)
  
  -- 6. Error: Find site identification number from the UK AIR ID string. (@test-m
  SSL certificate problem: unable to get local issuer certificate
  1: ukair_get_site_id(uka_id) at testthat/test-metadata.R:48
  2: t(sapply(id_s, ukair_get_site_id_internal))
  3: sapply(id_s, ukair_get_site_id_internal)
  4: lapply(X = X, FUN = FUN, ...)
  5: FUN(X[[i]], ...)
  6: httr::GET(url = "http://uk-air.defra.gov.uk", path = "networks/site-info", query = list(uka_id = uka_id, 
         search = "View+Site+Information", action = "site"))
  7: request_perform(req, hu$handle$handle)
  8: request_fetch(req$output, req$url, handle)
  9: request_fetch.write_memory(req$output, req$url, handle)
  10: curl::curl_fetch_memory(url, handle = handle)
  
  -- 7. Error: Find easting and northing coordinates of site UKA12536. (@test-meta
  SSL certificate problem: unable to get local issuer certificate
  1: ukair_get_coords(uka_id) at testthat/test-metadata.R:62
  2: ukair_get_coords.character(uka_id)
  3: id2coords(ids)
  4: data.frame(t(sapply(id_s, ukair_get_coords_internal)))
  5: t(sapply(id_s, ukair_get_coords_internal))
  6: sapply(id_s, ukair_get_coords_internal)
  7: lapply(X = X, FUN = FUN, ...)
  8: FUN(X[[i]], ...)
  9: httr::GET(url = "http://uk-air.defra.gov.uk", path = "networks/site-info", query = list(uka_id = uka_id))
  10: request_perform(req, hu$handle$handle)
  11: request_fetch(req$output, req$url, handle)
  12: request_fetch.write_memory(req$output, req$url, handle)
  13: curl::curl_fetch_memory(url, handle = handle)
  
  -- 8. Error: Find easting and northing coordinates of site UKA15910. (@test-meta
  SSL certificate problem: unable to get local issuer certificate
  1: ukair_get_coords(uka_id) at testthat/test-metadata.R:77
  2: ukair_get_coords.character(uka_id)
  3: id2coords(ids)
  4: data.frame(t(sapply(id_s, ukair_get_coords_internal)))
  5: t(sapply(id_s, ukair_get_coords_internal))
  6: sapply(id_s, ukair_get_coords_internal)
  7: lapply(X = X, FUN = FUN, ...)
  8: FUN(X[[i]], ...)
  9: httr::GET(url = "http://uk-air.defra.gov.uk", path = "networks/site-info", query = list(uka_id = uka_id))
  10: request_perform(req, hu$handle$handle)
  11: request_fetch(req$output, req$url, handle)
  12: request_fetch.write_memory(req$output, req$url, handle)
  13: curl::curl_fetch_memory(url, handle = handle)
  
  -- 9. Error: Find easting and northing coordinates of multiple sites. (@test-met
  SSL certificate problem: unable to get local issuer certificate
  1: ukair_get_coords(IDs) at testthat/test-metadata.R:91
  2: ukair_get_coords.character(IDs)
  3: id2coords(ids)
  4: data.frame(t(sapply(id_s, ukair_get_coords_internal)))
  5: t(sapply(id_s, ukair_get_coords_internal))
  6: sapply(id_s, ukair_get_coords_internal)
  7: lapply(X = X, FUN = FUN, ...)
  8: FUN(X[[i]], ...)
  9: httr::GET(url = "http://uk-air.defra.gov.uk", path = "networks/site-info", query = list(uka_id = uka_id))
  10: request_perform(req, hu$handle$handle)
  11: request_fetch(req$output, req$url, handle)
  12: request_fetch.write_memory(req$output, req$url, handle)
  13: curl::curl_fetch_memory(url, handle = handle)
  
  -- 10. Error: Infill missing coordinates from data frame. (@test-metadata.R#121)
  SSL certificate problem: unable to get local issuer certificate
  1: ukair_get_coords(stations) at testthat/test-metadata.R:121
  2: ukair_get_coords.data.frame(stations)
  3: id2coords(id_s)
  4: data.frame(t(sapply(id_s, ukair_get_coords_internal)))
  5: t(sapply(id_s, ukair_get_coords_internal))
  6: sapply(id_s, ukair_get_coords_internal)
  7: lapply(X = X, FUN = FUN, ...)
  8: FUN(X[[i]], ...)
  9: httr::GET(url = "http://uk-air.defra.gov.uk", path = "networks/site-info", query = list(uka_id = uka_id))
  10: request_perform(req, hu$handle$handle)
  11: request_fetch(req$output, req$url, handle)
  12: request_fetch.write_memory(req$output, req$url, handle)
  13: curl::curl_fetch_memory(url, handle = handle)
  
  == testthat results  ===========================================================
  OK: 23 SKIPPED: 1 FAILED: 10
  1.  Error: Hourly data for station ABD/2014 should be available (@test-data.R#11) 
  2.  Failure: Metadata should be in the right format (@test-data.R#44) 
  3.  Failure: Data should be in the right format (@test-data.R#55) 
  4.  Error: DEFRA server should be running (@test-metadata.R#13) 
  5.  Error: Up-to-date metadata catalogue should have at least 6569 stations. (@test-metadata.R#37) 
  6.  Error: Find site identification number from the UK AIR ID string. (@test-metadata.R#48) 
  7.  Error: Find easting and northing coordinates of site UKA12536. (@test-metadata.R#62) 
  8.  Error: Find easting and northing coordinates of site UKA15910. (@test-metadata.R#77) 
  9.  Error: Find easting and northing coordinates of multiple sites. (@test-metadata.R#91) 
  10. Error: Infill missing coordinates from data frame. (@test-metadata.R#121) 
  
  Error: testthat unit tests failed
  Execution halted