Running ‘testthat.R’ [15s/58s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library("testthat")
  > 
  > test_check("nhdplusTools")
  Loading required package: nhdplusTools
  Starting 2 test processes
  [ FAIL 23 | WARN 2 | SKIP 37 | PASS 52 ]
  
  ══ Skipped tests ═══════════════════════════════════════════════════════════════
  • On CRAN (37)
  
  ══ Failed tests ════════════════════════════════════════════════════════════════
  ── Error ('test_02_subset.R:35'): subset runs as expected ──────────────────────
  <Rcpp::exception/C++Error/error/condition>
  Error: Cannot open "/home/hornik/tmp/scratch/RtmpT2hLjU/nhdplusTools/sample_natseamless.gpkg"; The source could be corrupt or not supported. See `st_drivers()` for a list of supported formats.
  Backtrace:
      ▆
   1. └─sf::read_sf(sample_data, "NHDFlowline_Network") at test_02_subset.R:35:2
   2.   ├─sf::st_read(...)
   3.   └─sf:::st_read.character(...)
   4.     └─sf:::CPL_read_ogr(...)
  ── Error ('test_align_nhdplus_names.R:1'): (code run outside of `test_that()`) ──
  <Rcpp::exception/C++Error/error/condition>
  Error: Cannot open "/home/hornik/tmp/scratch/RtmpT2hLjU/nhdplusTools/new_hope.gpkg"; The source could be corrupt or not supported. See `st_drivers()` for a list of supported formats.
  Backtrace:
      ▆
   1. ├─base::source(system.file("extdata/new_hope_data.R", package = "nhdplusTools")) at test_align_nhdplus_names.R:1:0
   2. │ ├─base::withVisible(eval(ei, envir))
   3. │ └─base::eval(ei, envir)
   4. │   └─base::eval(ei, envir)
   5. └─sf::read_sf(file.path(data_dir, f), "CatchmentSP")
   6.   ├─sf::st_read(...)
   7.   └─sf:::st_read.character(...)
   8.     └─sf:::CPL_read_ogr(...)
  ── Error ('test_02_subset_extras.R:12'): subset by bounding box ────────────────
  <Rcpp::exception/C++Error/error/condition>
  Error in `CPL_get_layers(dsn, options, do_count)`: Open failed.
  
  Backtrace:
      ▆
   1. └─nhdplusTools::subset_nhdplus(...) at test_02_subset_extras.R:12:2
   2.   └─nhdplusTools:::get_catchment_layer_name(simplified, nhdplus_data)
   3.     ├─layer_name %in% sf::st_layers(nhdplus_data)$name
   4.     └─sf::st_layers(nhdplus_data)
   5.       └─sf:::CPL_get_layers(dsn, options, do_count)
  ── Error ('test_02_subset_extras.R:83'): prep_nhdplus runs as expected ─────────
  <Rcpp::exception/C++Error/error/condition>
  Error in `CPL_get_layers(dsn, options, do_count)`: Open failed.
  
  Backtrace:
       ▆
    1. ├─testthat::expect_warning(...) at test_02_subset_extras.R:83:2
    2. │ └─testthat:::expect_condition_matching(...)
    3. │   └─testthat:::quasi_capture(...)
    4. │     ├─testthat (local) .capture(...)
    5. │     │ └─base::withCallingHandlers(...)
    6. │     └─rlang::eval_bare(quo_get_expr(.quo), quo_get_env(.quo))
    7. └─nhdplusTools::stage_national_data()
    8.   ├─sf::st_zm(sf::read_sf(nhdplus_data, get_flowline_layer_name(nhdplus_data)))
    9.   ├─sf::read_sf(nhdplus_data, get_flowline_layer_name(nhdplus_data))
   10.   │ ├─sf::st_read(...)
   11.   │ └─sf:::st_read.character(...)
   12.   └─nhdplusTools:::get_flowline_layer_name(nhdplus_data)
   13.     ├─layer_name %in% sf::st_layers(nhdplus_data)$name
   14.     └─sf::st_layers(nhdplus_data)
   15.       └─sf:::CPL_get_layers(dsn, options, do_count)
  ── Error ('test_02_subset_extras.R:126'): by rpu ───────────────────────────────
  <Rcpp::exception/C++Error/error/condition>
  Error in `CPL_get_layers(dsn, options, do_count)`: Open failed.
  
  Backtrace:
      ▆
   1. └─nhdplusTools::stage_national_data(output_path = tempdir()) at test_02_subset_extras.R:126:2
   2.   ├─sf::st_zm(sf::read_sf(nhdplus_data, get_flowline_layer_name(nhdplus_data)))
   3.   ├─sf::read_sf(nhdplus_data, get_flowline_layer_name(nhdplus_data))
   4.   │ ├─sf::st_read(...)
   5.   │ └─sf:::st_read.character(...)
   6.   └─nhdplusTools:::get_flowline_layer_name(nhdplus_data)
   7.     ├─layer_name %in% sf::st_layers(nhdplus_data)$name
   8.     └─sf::st_layers(nhdplus_data)
   9.       └─sf:::CPL_get_layers(dsn, options, do_count)
  ── Error ('test_get_codes.R:1'): (code run outside of `test_that()`) ───────────
  <Rcpp::exception/C++Error/error/condition>
  Error: Cannot open "/home/hornik/tmp/scratch/Rtmp0TQVJZ/nhdplusTools/walker.gpkg"; The source could be corrupt or not supported. See `st_drivers()` for a list of supported formats.
  Backtrace:
      ▆
   1. ├─base::source(system.file("extdata", "walker_data.R", package = "nhdplusTools")) at test_get_codes.R:1:0
   2. │ ├─base::withVisible(eval(ei, envir))
   3. │ └─base::eval(ei, envir)
   4. │   └─base::eval(ei, envir)
   5. └─sf::read_sf(file.path(data_dir, f), "CatchmentSP")
   6.   ├─sf::st_read(...)
   7.   └─sf:::st_read.character(...)
   8.     └─sf:::CPL_read_ogr(...)
  ── Error ('test_calc_network.R:4'): total drainage area works ──────────────────
  <Rcpp::exception/C++Error/error/condition>
  Error: Cannot open "/home/hornik/tmp/scratch/RtmpT2hLjU/nhdplusTools/walker.gpkg"; The source could be corrupt or not supported. See `st_drivers()` for a list of supported formats.
  Backtrace:
      ▆
   1. ├─base::source(system.file("extdata", "walker_data.R", package = "nhdplusTools")) at test_calc_network.R:4:2
   2. │ ├─base::withVisible(eval(ei, envir))
   3. │ └─base::eval(ei, envir)
   4. │   └─base::eval(ei, envir)
   5. └─sf::read_sf(file.path(data_dir, f), "CatchmentSP")
   6.   ├─sf::st_read(...)
   7.   └─sf:::st_read.character(...)
   8.     └─sf:::CPL_read_ogr(...)
  ── Error ('test_calc_network.R:27'): arbolate sum works ────────────────────────
  <Rcpp::exception/C++Error/error/condition>
  Error: Cannot open "/home/hornik/tmp/scratch/RtmpT2hLjU/nhdplusTools/walker.gpkg"; The source could be corrupt or not supported. See `st_drivers()` for a list of supported formats.
  Backtrace:
      ▆
   1. ├─base::source(system.file("extdata", "walker_data.R", package = "nhdplusTools")) at test_calc_network.R:27:2
   2. │ ├─base::withVisible(eval(ei, envir))
   3. │ └─base::eval(ei, envir)
   4. │   └─base::eval(ei, envir)
   5. └─sf::read_sf(file.path(data_dir, f), "CatchmentSP")
   6.   ├─sf::st_read(...)
   7.   └─sf:::st_read.character(...)
   8.     └─sf:::CPL_read_ogr(...)
  ── Error ('test_calc_network.R:45'): get_terminal ──────────────────────────────
  Error in `zip::unzip(d, exdir = work_dir)`: zip error: `Cannot open zip file `/home/hornik/tmp/scratch/RtmpT2hLjU/nhdplusTools/03_sub.zip` for reading` in file `zip.c:140`
  Backtrace:
      ▆
   1. ├─base::suppressMessages(...) at test_calc_network.R:45:2
   2. │ └─base::withCallingHandlers(...)
   3. ├─base::source(system.file("extdata/nhdplushr_data.R", package = "nhdplusTools"))
   4. │ ├─base::withVisible(eval(ei, envir))
   5. │ └─base::eval(ei, envir)
   6. │   └─base::eval(ei, envir)
   7. └─global download_pkg_data(...)
   8.   └─zip::unzip(d, exdir = work_dir)
  ── Error ('test_calc_network.R:76'): get_terminal ──────────────────────────────
  <Rcpp::exception/C++Error/error/condition>
  Error: Cannot open "/home/hornik/tmp/scratch/RtmpT2hLjU/nhdplusTools/walker.gpkg"; The source could be corrupt or not supported. See `st_drivers()` for a list of supported formats.
  Backtrace:
      ▆
   1. ├─base::source(system.file("extdata", "walker_data.R", package = "nhdplusTools")) at test_calc_network.R:76:2
   2. │ ├─base::withVisible(eval(ei, envir))
   3. │ └─base::eval(ei, envir)
   4. │   └─base::eval(ei, envir)
   5. └─sf::read_sf(file.path(data_dir, f), "CatchmentSP")
   6.   ├─sf::st_read(...)
   7.   └─sf:::st_read.character(...)
   8.     └─sf:::CPL_read_ogr(...)
  ── Error ('test_get_network.R:3'): (code run outside of `test_that()`) ─────────
  <Rcpp::exception/C++Error/error/condition>
  Error: Cannot open "/home/hornik/tmp/scratch/RtmpT2hLjU/nhdplusTools/petapsco_flowlines.gpkg"; The source could be corrupt or not supported. See `st_drivers()` for a list of supported formats.
  Backtrace:
      ▆
   1. ├─base::source(system.file("extdata", "sample_flines.R", package = "nhdplusTools")) at test_get_network.R:3:0
   2. │ ├─base::withVisible(eval(ei, envir))
   3. │ └─base::eval(ei, envir)
   4. │   └─base::eval(ei, envir)
   5. └─sf::read_sf(file.path(data_dir, "petapsco_flowlines.gpkg"))
   6.   ├─sf::st_read(...)
   7.   └─sf:::st_read.character(...)
   8.     └─sf:::CPL_read_ogr(...)
  ── Error ('test_get_geometry.R:4'): get_node ───────────────────────────────────
  <Rcpp::exception/C++Error/error/condition>
  Error: Cannot open "/home/hornik/tmp/scratch/Rtmp0TQVJZ/nhdplusTools/sample_natseamless.gpkg"; The source could be corrupt or not supported. See `st_drivers()` for a list of supported formats.
  Backtrace:
      ▆
   1. └─sf::read_sf(sample_data, "NHDFlowline_Network") at test_get_geometry.R:4:2
   2.   ├─sf::st_read(...)
   3.   └─sf:::st_read.character(...)
   4.     └─sf:::CPL_read_ogr(...)
  ── Error ('test_get_geometry.R:28'): fix_flowdir ───────────────────────────────
  <Rcpp::exception/C++Error/error/condition>
  Error: Cannot open "/home/hornik/tmp/scratch/Rtmp0TQVJZ/nhdplusTools/sample_natseamless.gpkg"; The source could be corrupt or not supported. See `st_drivers()` for a list of supported formats.
  Backtrace:
      ▆
   1. └─sf::read_sf(sample_data, "NHDFlowline_Network") at test_get_geometry.R:28:2
   2.   ├─sf::st_read(...)
   3.   └─sf:::st_read.character(...)
   4.     └─sf:::CPL_read_ogr(...)
  ── Error ('test_get_nhdplus.R:3'): (code run outside of `test_that()`) ─────────
  <Rcpp::exception/C++Error/error/condition>
  Error: Cannot open "/home/hornik/tmp/scratch/RtmpT2hLjU/nhdplusTools/petapsco_flowlines.gpkg"; The source could be corrupt or not supported. See `st_drivers()` for a list of supported formats.
  Backtrace:
      ▆
   1. ├─base::source(system.file("extdata", "sample_flines.R", package = "nhdplusTools")) at test_get_nhdplus.R:3:0
   2. │ ├─base::withVisible(eval(ei, envir))
   3. │ └─base::eval(ei, envir)
   4. │   └─base::eval(ei, envir)
   5. └─sf::read_sf(file.path(data_dir, "petapsco_flowlines.gpkg"))
   6.   ├─sf::st_read(...)
   7.   └─sf:::st_read.character(...)
   8.     └─sf:::CPL_read_ogr(...)
  ── Error ('test_get_nhdplushr.R:14'): (code run outside of `test_that()`) ──────
  Error in `download.file("https://usgs-r.github.io/nhdplusTools/data/03_sub.zip", 
      temp_file, quiet = FALSE)`: cannot open URL 'https://usgs-r.github.io/nhdplusTools/data/03_sub.zip'
  Backtrace:
      ▆
   1. └─nhdplusTools:::get_test_file(work_dir) at test_get_nhdplushr.R:14:0
   2.   └─utils::download.file(...) at tests/testthat/helper.R:15:4
  ── Error ('test_get_path_lengths.R:3'): path_lengths ───────────────────────────
  <Rcpp::exception/C++Error/error/condition>
  Error: Cannot open "/home/hornik/tmp/scratch/Rtmp0TQVJZ/nhdplusTools/walker.gpkg"; The source could be corrupt or not supported. See `st_drivers()` for a list of supported formats.
  Backtrace:
      ▆
   1. ├─base::source(system.file("extdata", "walker_data.R", package = "nhdplusTools")) at test_get_path_lengths.R:3:2
   2. │ ├─base::withVisible(eval(ei, envir))
   3. │ └─base::eval(ei, envir)
   4. │   └─base::eval(ei, envir)
   5. └─sf::read_sf(file.path(data_dir, f), "CatchmentSP")
   6.   ├─sf::st_read(...)
   7.   └─sf:::st_read.character(...)
   8.     └─sf:::CPL_read_ogr(...)
  ── Error ('test_get_path_lengths.R:44'): get_partial_length ────────────────────
  <Rcpp::exception/C++Error/error/condition>
  Error: Cannot open "/home/hornik/tmp/scratch/Rtmp0TQVJZ/nhdplusTools/walker.gpkg"; The source could be corrupt or not supported. See `st_drivers()` for a list of supported formats.
  Backtrace:
      ▆
   1. ├─base::source(system.file("extdata", "walker_data.R", package = "nhdplusTools")) at test_get_path_lengths.R:44:2
   2. │ ├─base::withVisible(eval(ei, envir))
   3. │ └─base::eval(ei, envir)
   4. │   └─base::eval(ei, envir)
   5. └─sf::read_sf(file.path(data_dir, f), "CatchmentSP")
   6.   ├─sf::st_read(...)
   7.   └─sf:::st_read.character(...)
   8.     └─sf:::CPL_read_ogr(...)
  ── Error ('test_get_path.R:14'): calculate level path ──────────────────────────
  <Rcpp::exception/C++Error/error/condition>
  Error: Cannot open "/home/hornik/tmp/scratch/RtmpT2hLjU/nhdplusTools/walker.gpkg"; The source could be corrupt or not supported. See `st_drivers()` for a list of supported formats.
  Backtrace:
      ▆
   1. ├─base::source(system.file("extdata", "walker_data.R", package = "nhdplusTools")) at test_get_path.R:14:2
   2. │ ├─base::withVisible(eval(ei, envir))
   3. │ └─base::eval(ei, envir)
   4. │   └─base::eval(ei, envir)
   5. └─sf::read_sf(file.path(data_dir, f), "CatchmentSP")
   6.   ├─sf::st_read(...)
   7.   └─sf:::st_read.character(...)
   8.     └─sf:::CPL_read_ogr(...)
  ── Error ('test_get_path.R:102'): from vignette works ──────────────────────────
  <Rcpp::exception/C++Error/error/condition>
  Error: Cannot open "/home/hornik/tmp/scratch/RtmpT2hLjU/nhdplusTools/new_hope.gpkg"; The source could be corrupt or not supported. See `st_drivers()` for a list of supported formats.
  Backtrace:
      ▆
   1. ├─base::source(system.file("extdata/new_hope_data.R", package = "nhdplusTools")) at test_get_path.R:102:2
   2. │ ├─base::withVisible(eval(ei, envir))
   3. │ └─base::eval(ei, envir)
   4. │   └─base::eval(ei, envir)
   5. └─sf::read_sf(file.path(data_dir, f), "CatchmentSP")
   6.   ├─sf::st_read(...)
   7.   └─sf:::st_read.character(...)
   8.     └─sf:::CPL_read_ogr(...)
  ── Error ('test_index.R:3'): (code run outside of `test_that()`) ───────────────
  <Rcpp::exception/C++Error/error/condition>
  Error: Cannot open "/home/hornik/tmp/scratch/RtmpT2hLjU/nhdplusTools/petapsco_flowlines.gpkg"; The source could be corrupt or not supported. See `st_drivers()` for a list of supported formats.
  Backtrace:
      ▆
   1. ├─base::source(system.file("extdata", "sample_flines.R", package = "nhdplusTools")) at test_index.R:3:0
   2. │ ├─base::withVisible(eval(ei, envir))
   3. │ └─base::eval(ei, envir)
   4. │   └─base::eval(ei, envir)
   5. └─sf::read_sf(file.path(data_dir, "petapsco_flowlines.gpkg"))
   6.   ├─sf::st_read(...)
   7.   └─sf:::st_read.character(...)
   8.     └─sf:::CPL_read_ogr(...)
  ── Error ('test_nhdplusTools.R:3'): (code run outside of `test_that()`) ────────
  <Rcpp::exception/C++Error/error/condition>
  Error: Cannot open "/home/hornik/tmp/scratch/RtmpT2hLjU/nhdplusTools/petapsco_flowlines.gpkg"; The source could be corrupt or not supported. See `st_drivers()` for a list of supported formats.
  Backtrace:
      ▆
   1. ├─base::source(system.file("extdata", "sample_flines.R", package = "nhdplusTools")) at test_nhdplusTools.R:3:0
   2. │ ├─base::withVisible(eval(ei, envir))
   3. │ └─base::eval(ei, envir)
   4. │   └─base::eval(ei, envir)
   5. └─sf::read_sf(file.path(data_dir, "petapsco_flowlines.gpkg"))
   6.   ├─sf::st_read(...)
   7.   └─sf:::st_read.character(...)
   8.     └─sf:::CPL_read_ogr(...)
  ── Error ('test_rebuild_topology.R:1'): (code run outside of `test_that()`) ────
  <Rcpp::exception/C++Error/error/condition>
  Error: Cannot open "/home/hornik/tmp/scratch/Rtmp0TQVJZ/nhdplusTools/petapsco_flowlines.gpkg"; The source could be corrupt or not supported. See `st_drivers()` for a list of supported formats.
  Backtrace:
      ▆
   1. ├─base::source(system.file("extdata", "sample_flines.R", package = "nhdplusTools")) at test_rebuild_topology.R:1:0
   2. │ ├─base::withVisible(eval(ei, envir))
   3. │ └─base::eval(ei, envir)
   4. │   └─base::eval(ei, envir)
   5. └─sf::read_sf(file.path(data_dir, "petapsco_flowlines.gpkg"))
   6.   ├─sf::st_read(...)
   7.   └─sf:::st_read.character(...)
   8.     └─sf:::CPL_read_ogr(...)
  ── Error ('test_wb_index.R:4'): index to waterbodies ───────────────────────────
  <Rcpp::exception/C++Error/error/condition>
  Error: Cannot open "/home/hornik/tmp/scratch/RtmpT2hLjU/nhdplusTools/sample_natseamless.gpkg"; The source could be corrupt or not supported. See `st_drivers()` for a list of supported formats.
  Backtrace:
      ▆
   1. └─sf::read_sf(sample_data, "NHDWaterbody") at test_wb_index.R:4:0
   2.   ├─sf::st_read(...)
   3.   └─sf:::st_read.character(...)
   4.     └─sf:::CPL_read_ogr(...)
  
  [ FAIL 23 | WARN 2 | SKIP 37 | PASS 52 ]
  Error: Test failures
  Execution halted