Running ‘testthat.R’ [54s/68s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(metR)
  > # library(vdiffr)
  > 
  > test_check("metR")
  ── 1. Error: returns a data.table (@test_ReadNetCDF.R#6)  ──────────────────────
  Error in nc_open trying to open file /home/ripley/R/Lib32/metR/extdata/temperature.nc
  1: expect_known_output(ReadNetCDF(file), "readnetcdf_default") at testthat/test_ReadNetCDF.R:6
  2: append(act, eval_with_output(object, print = print, width = width))
  3: eval_with_output(object, print = print, width = width)
  4: withr::with_output_sink(temp, withVisible(code))
  5: force(code)
  6: withVisible(code)
  7: ReadNetCDF(file)
  8: ncdf4::nc_open(file)
  9: stop(paste("Error in nc_open trying to open file", filename))
  
  ── 2. Error: subsetting works (@test_ReadNetCDF.R#11)  ─────────────────────────
  Error in nc_open trying to open file /home/ripley/R/Lib32/metR/extdata/temperature.nc
  1: expect_known_output(ReadNetCDF(file, subset = list(lat = -90:20)), "readnetcdf_subset") at testthat/test_ReadNetCDF.R:11
  2: append(act, eval_with_output(object, print = print, width = width))
  3: eval_with_output(object, print = print, width = width)
  4: withr::with_output_sink(temp, withVisible(code))
  5: force(code)
  6: withVisible(code)
  7: ReadNetCDF(file, subset = list(lat = -90:20))
  8: ncdf4::nc_open(file)
  9: stop(paste("Error in nc_open trying to open file", filename))
  
  Error in R_nc4_open: NetCDF: HDF error
  ── 3. Error: naming works (@test_ReadNetCDF.R#17)  ─────────────────────────────
  Error in nc_open trying to open file /home/ripley/R/Lib32/metR/extdata/temperature.nc
  1: expect_true({
         t <- ReadNetCDF(file, vars = c(air2 = "air"))
         "air2" %in% colnames(t)
     }) at testthat/test_ReadNetCDF.R:17
  2: quasi_label(enquo(object), label, arg = "object")
  3: eval_bare(get_expr(quo), get_env(quo))
  4: ReadNetCDF(file, vars = c(air2 = "air")) at testthat/test_ReadNetCDF.R:18
  5: ncdf4::nc_open(file)
  6: stop(paste("Error in nc_open trying to open file", filename))
  
  Error in R_nc4_open: NetCDF: HDF error
  ── 4. Error: different outs work (@test_ReadNetCDF.R#24)  ──────────────────────
  Error in nc_open trying to open file /home/ripley/R/Lib32/metR/extdata/temperature.nc
  1: expect_s3_class(ReadNetCDF(file), "data.table") at testthat/test_ReadNetCDF.R:24
  2: quasi_label(enquo(object), arg = "object")
  3: eval_bare(get_expr(quo), get_env(quo))
  4: ReadNetCDF(file)
  5: ncdf4::nc_open(file)
  6: stop(paste("Error in nc_open trying to open file", filename))
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  [ OK: 53 | SKIPPED: 0 | WARNINGS: 0 | FAILED: 4 ]
  1. Error: returns a data.table (@test_ReadNetCDF.R#6) 
  2. Error: subsetting works (@test_ReadNetCDF.R#11) 
  3. Error: naming works (@test_ReadNetCDF.R#17) 
  4. Error: different outs work (@test_ReadNetCDF.R#24) 
  
  Error: testthat unit tests failed
  Execution halted