Running ‘testthat.R’ [106s/90s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > # load packages
  > library(testthat)
  > library(prioritizr)
  Loading required package: raster
  Loading required package: sp
  > 
  > # load solver packages
  > require(gurobi)
  Loading required package: gurobi
  Warning message:
  In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
    there is no package called 'gurobi'
  > require(lpsymphony)
  Loading required package: lpsymphony
  Warning message:
  In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
    there is no package called 'lpsymphony'
  > require(Rsymphony)
  Loading required package: Rsymphony
  Warning message:
  In library(package, lib.loc = lib.loc, character.only = TRUE, logical.return = TRUE,  :
    there is no package called 'Rsymphony'
  > 
  > # enable parallel testing
  > Sys.unsetenv("R_TESTS")
  > 
  > # run tests
  > test_check("prioritizr")
  list()
  attr(,"class")
  [1] "Waiver"
  1. Error: minimum set objective (compile binary decisions) (@test_add_boundary_penalties.R#11) 
  no optimization problem solvers found on system.
  1: compile(p) at testthat/test_add_boundary_penalties.R:11
  2: compile.ConservationProblem(p)
  3: add_default_solver(x)
  4: stop("no optimization problem solvers found on system.")
  
  2. Error: maximum coverage objective (compile binary decisions) (@test_add_boundary_penalties.R#120) 
  no optimization problem solvers found on system.
  1: compile(p) at testthat/test_add_boundary_penalties.R:120
  2: compile.ConservationProblem(p)
  3: add_default_solver(x)
  4: stop("no optimization problem solvers found on system.")
  
  3. Error: compile (@test_add_connected_constraints.R#12) -----------------------
  no optimization problem solvers found on system.
  1: compile(p) at testthat/test_add_connected_constraints.R:12
  2: compile.ConservationProblem(p)
  3: add_default_solver(x)
  4: stop("no optimization problem solvers found on system.")
  
  4. Error: minimum set objective (compile binary decisions) (@test_add_connectivity_penalties.R#13) 
  no optimization problem solvers found on system.
  1: compile(p) at testthat/test_add_connectivity_penalties.R:13
  2: compile.ConservationProblem(p)
  3: add_default_solver(x)
  4: stop("no optimization problem solvers found on system.")
  
  5. Error: maximum representation objective (compile binary decisions) (@test_add_connectivity_penalties.R#136) 
  no optimization problem solvers found on system.
  1: compile(p) at testthat/test_add_connectivity_penalties.R:136
  2: compile.ConservationProblem(p)
  3: add_default_solver(x)
  4: stop("no optimization problem solvers found on system.")
  
  6. Error: compile (@test_add_corridor_constraints.R#24) ------------------------
  no optimization problem solvers found on system.
  1: problem(cost, features) %>% add_min_set_objective() %>% add_relative_targets(0.1) %>% 
         add_corridor_constraints(conductance, rep(0.8, nlayers(features))) %>% add_default_solver(time_limit = 5) at testthat/test_add_corridor_constraints.R:24
  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: add_default_solver(., time_limit = 5)
  10: stop("no optimization problem solvers found on system.")
  
  7. Error: list input (compile) (@test_add_corridor_constraints.R#174) ----------
  no optimization problem solvers found on system.
  1: problem(cost, features) %>% add_min_set_objective() %>% add_relative_targets(0.1) %>% 
         add_corridor_constraints(connectivity_matrices, rep(0.8, nlayers(features))) %>% 
         compile() at testthat/test_add_corridor_constraints.R:174
  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: compile(.)
  10: compile.ConservationProblem(.)
  11: add_default_solver(x)
  12: stop("no optimization problem solvers found on system.")
  
  8. Error: compile (@test_add_cuts_portfolio.R#10) ------------------------------
  no optimization problem solvers found on system.
  1: problem(cost, features) %>% add_min_set_objective() %>% add_absolute_targets(c(2, 
         10)) %>% add_locked_in_constraints(locked_in) %>% add_cuts_portfolio(2) %>% add_default_solver(gap = 0.2) at testthat/test_add_cuts_portfolio.R:10
  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: add_default_solver(., gap = 0.2)
  10: stop("no optimization problem solvers found on system.")
  
  9. Error: integer locked in data (compile) (@test_add_locked_in_constraints.R#11) 
  no optimization problem solvers found on system.
  1: compile(p) at testthat/test_add_locked_in_constraints.R:11
  2: compile.ConservationProblem(p)
  3: add_default_solver(x)
  4: stop("no optimization problem solvers found on system.")
  
  10. Error: character locked in data (compile) (@test_add_locked_in_constraints.R#51) 
  no optimization problem solvers found on system.
  1: compile(p) at testthat/test_add_locked_in_constraints.R:51
  2: compile.ConservationProblem(p)
  3: add_default_solver(x)
  4: stop("no optimization problem solvers found on system.")
  
  11. Error: raster locked in data (compile) (@test_add_locked_in_constraints.R#109) 
  no optimization problem solvers found on system.
  1: compile(p) at testthat/test_add_locked_in_constraints.R:109
  2: compile.ConservationProblem(p)
  3: add_default_solver(x)
  4: stop("no optimization problem solvers found on system.")
  
  12. Error: spatial locked in data (compile) (@test_add_locked_in_constraints.R#182) 
  no optimization problem solvers found on system.
  1: compile(p) at testthat/test_add_locked_in_constraints.R:182
  2: compile.ConservationProblem(p)
  3: add_default_solver(x)
  4: stop("no optimization problem solvers found on system.")
  
  13. Error: integer locked out data (compile) (@test_add_locked_out_constraints.R#11) 
  no optimization problem solvers found on system.
  1: compile(p) at testthat/test_add_locked_out_constraints.R:11
  2: compile.ConservationProblem(p)
  3: add_default_solver(x)
  4: stop("no optimization problem solvers found on system.")
  
  14. Error: character locked out data (compile) (@test_add_locked_out_constraints.R#57) 
  no optimization problem solvers found on system.
  1: compile(p) at testthat/test_add_locked_out_constraints.R:57
  2: compile.ConservationProblem(p)
  3: add_default_solver(x)
  4: stop("no optimization problem solvers found on system.")
  
  15. Error: raster locked out data (compile) (@test_add_locked_out_constraints.R#115) 
  no optimization problem solvers found on system.
  1: compile(p) at testthat/test_add_locked_out_constraints.R:115
  2: compile.ConservationProblem(p)
  3: add_default_solver(x)
  4: stop("no optimization problem solvers found on system.")
  
  16. Error: spatial locked out data (compile) (@test_add_locked_out_constraints.R#188) 
  no optimization problem solvers found on system.
  1: compile(p) at testthat/test_add_locked_out_constraints.R:188
  2: compile.ConservationProblem(p)
  3: add_default_solver(x)
  4: stop("no optimization problem solvers found on system.")
  
  17. Error: compile (compressed formulation) (@test_add_max_cover_objective.R#10) 
  no optimization problem solvers found on system.
  1: compile(p) at testthat/test_add_max_cover_objective.R:10
  2: compile.ConservationProblem(p)
  3: add_default_solver(x)
  4: stop("no optimization problem solvers found on system.")
  
  18. Error: solution (compressed formulation) (@test_add_max_cover_objective.R#41) 
  no optimization problem solvers found on system.
  1: problem(cost, features) %>% add_max_cover_objective(budget = budget) %>% add_locked_out_constraints(locked_out) %>% 
         add_default_solver(time_limit = 5) at testthat/test_add_max_cover_objective.R:41
  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: add_default_solver(., time_limit = 5)
  10: stop("no optimization problem solvers found on system.")
  
  19. Error: compile (expanded formulation) (@test_add_max_cover_objective.R#58) -
  no optimization problem solvers found on system.
  1: compile(p, compressed_formulation = FALSE) at testthat/test_add_max_cover_objective.R:58
  2: compile.ConservationProblem(p, compressed_formulation = FALSE)
  3: add_default_solver(x)
  4: stop("no optimization problem solvers found on system.")
  
  20. Error: invalid inputs (@test_add_max_cover_objective.R#118) ----------------
  no optimization problem solvers found on system.
  1: expect_warning({
         problem(sim_pu_raster, sim_features) %>% add_max_cover_objective(budget = 5000) %>% 
             add_relative_targets(0.1) %>% compile()
     }) at testthat/test_add_max_cover_objective.R:118
  2: capture_warnings(object)
  3: withCallingHandlers(code, warning = function(condition) {
         out$push(condition)
         invokeRestart("muffleWarning")
     })
  4: problem(sim_pu_raster, sim_features) %>% add_max_cover_objective(budget = 5000) %>% 
         add_relative_targets(0.1) %>% compile() at testthat/test_add_max_cover_objective.R:119
  5: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  6: eval(quote(`_fseq`(`_lhs`)), env, env)
  7: eval(quote(`_fseq`(`_lhs`)), env, env)
  8: `_fseq`(`_lhs`)
  9: freduce(value, `_function_list`)
  10: withVisible(function_list[[k]](value))
  11: function_list[[k]](value)
  12: compile(.)
  13: compile.ConservationProblem(.)
  14: add_default_solver(x)
  15: stop("no optimization problem solvers found on system.")
  
  21. Error: compile (compressed formulation) (@test_add_max_features_objective.R#12) 
  no optimization problem solvers found on system.
  1: compile(p) at testthat/test_add_max_features_objective.R:12
  2: compile.ConservationProblem(p)
  3: add_default_solver(x)
  4: stop("no optimization problem solvers found on system.")
  
  22. Error: compile (expanded formulation) (@test_add_max_features_objective.R#66) 
  no optimization problem solvers found on system.
  1: compile(p, compressed_formulation = FALSE) at testthat/test_add_max_features_objective.R:66
  2: compile.ConservationProblem(p, compressed_formulation = FALSE)
  3: add_default_solver(x)
  4: stop("no optimization problem solvers found on system.")
  
  23. Error: compile (compressed formulation) (@test_add_max_phylo_objective.R#12) 
  no optimization problem solvers found on system.
  1: compile(p) at testthat/test_add_max_phylo_objective.R:12
  2: compile.ConservationProblem(p)
  3: add_default_solver(x)
  4: stop("no optimization problem solvers found on system.")
  
  24. Error: compile (expanded formulation) (@test_add_max_phylo_objective.R#93) -
  no optimization problem solvers found on system.
  1: compile(p, compressed_formulation = FALSE) at testthat/test_add_max_phylo_objective.R:93
  2: compile.ConservationProblem(p, compressed_formulation = FALSE)
  3: add_default_solver(x)
  4: stop("no optimization problem solvers found on system.")
  
  25. Error: compile (compressed formulation) (@test_add_max_utility_objective.R#9) 
  no optimization problem solvers found on system.
  1: compile(p) at testthat/test_add_max_utility_objective.R:9
  2: compile.ConservationProblem(p)
  3: add_default_solver(x)
  4: stop("no optimization problem solvers found on system.")
  
  26. Error: compile (expanded formulation) (@test_add_max_utility_objective.R#60) 
  no optimization problem solvers found on system.
  1: compile(p, compressed_formulation = FALSE) at testthat/test_add_max_utility_objective.R:60
  2: compile.ConservationProblem(p, compressed_formulation = FALSE)
  3: add_default_solver(x)
  4: stop("no optimization problem solvers found on system.")
  
  27. Error: invalid inputs (@test_add_max_utility_objective.R#123) --------------
  no optimization problem solvers found on system.
  1: expect_warning({
         problem(sim_pu_raster, sim_features) %>% add_max_utility_objective(budget = 5000) %>% 
             add_relative_targets(0.1) %>% compile()
     }) at testthat/test_add_max_utility_objective.R:123
  2: capture_warnings(object)
  3: withCallingHandlers(code, warning = function(condition) {
         out$push(condition)
         invokeRestart("muffleWarning")
     })
  4: problem(sim_pu_raster, sim_features) %>% add_max_utility_objective(budget = 5000) %>% 
         add_relative_targets(0.1) %>% compile() at testthat/test_add_max_utility_objective.R:124
  5: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  6: eval(quote(`_fseq`(`_lhs`)), env, env)
  7: eval(quote(`_fseq`(`_lhs`)), env, env)
  8: `_fseq`(`_lhs`)
  9: freduce(value, `_function_list`)
  10: withVisible(function_list[[k]](value))
  11: function_list[[k]](value)
  12: compile(.)
  13: compile.ConservationProblem(.)
  14: add_default_solver(x)
  15: stop("no optimization problem solvers found on system.")
  
  28. Error: compile (compressed formulation) (@test_add_min_set_objective.R#11) -
  no optimization problem solvers found on system.
  1: compile(p) at testthat/test_add_min_set_objective.R:11
  2: compile.ConservationProblem(p)
  3: add_default_solver(x)
  4: stop("no optimization problem solvers found on system.")
  
  29. Error: compile (expanded formulation) (@test_add_min_set_objective.R#54) ---
  no optimization problem solvers found on system.
  1: compile(p, FALSE) at testthat/test_add_min_set_objective.R:54
  2: compile.ConservationProblem(p, FALSE)
  3: add_default_solver(x)
  4: stop("no optimization problem solvers found on system.")
  
  30. Error: compile (@test_add_neighbor_constraints.R#12) -----------------------
  no optimization problem solvers found on system.
  1: compile(p) at testthat/test_add_neighbor_constraints.R:12
  2: compile.ConservationProblem(p)
  3: add_default_solver(x)
  4: stop("no optimization problem solvers found on system.")
  
  31. Error: compile (@test_add_shuffle_portfolio.R#9) ---------------------------
  no optimization problem solvers found on system.
  1: problem(cost, features) %>% add_min_set_objective() %>% add_absolute_targets(c(2, 
         10)) %>% add_shuffle_portfolio(2) %>% add_default_solver(gap = 0.2) at testthat/test_add_shuffle_portfolio.R:9
  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: add_default_solver(., gap = 0.2)
  10: stop("no optimization problem solvers found on system.")
  
  32. Error: add_binary_decisions (compile) (@test_decisions.R#10) ---------------
  no optimization problem solvers found on system.
  1: compile(p) at testthat/test_decisions.R:10
  2: compile.ConservationProblem(p)
  3: add_default_solver(x)
  4: stop("no optimization problem solvers found on system.")
  
  33. Error: add_proportion_decisions (compile) (@test_decisions.R#39) -----------
  no optimization problem solvers found on system.
  1: compile(p) at testthat/test_decisions.R:39
  2: compile.ConservationProblem(p)
  3: add_default_solver(x)
  4: stop("no optimization problem solvers found on system.")
  
  34. Error: add_semicontinuous_decisions (compile) (@test_decisions.R#69) -------
  no optimization problem solvers found on system.
  1: compile(p) at testthat/test_decisions.R:69
  2: compile.ConservationProblem(p)
  3: add_default_solver(x)
  4: stop("no optimization problem solvers found on system.")
  
  35. Error: spatial data input (compile) (@test_marxan_problem.R#13) ------------
  no optimization problem solvers found on system.
  1: compile(p1) at testthat/test_marxan_problem.R:13
  2: compile.ConservationProblem(p1)
  3: add_default_solver(x)
  4: stop("no optimization problem solvers found on system.")
  
  36. Error: character filename input (compile symmetric boundary penalties) (@test_marxan_problem.R#49) 
  no optimization problem solvers found on system.
  1: compile(p) at testthat/test_marxan_problem.R:49
  2: compile.ConservationProblem(p)
  3: add_default_solver(x)
  4: stop("no optimization problem solvers found on system.")
  
  37. Error: data.frame input (compile asymmetric boundary penalties) (@test_marxan_problem.R#200) 
  no optimization problem solvers found on system.
  1: compile(p) at testthat/test_marxan_problem.R:200
  2: compile.ConservationProblem(p)
  3: add_default_solver(x)
  4: stop("no optimization problem solvers found on system.")
  
  ..
  ..
  ..
  38. Error: x=Raster, y=RasterStack (@test_solve.R#9) ---------------------------
  no optimization problem solvers found on system.
  1: problem(costs, spp) %>% add_min_set_objective() %>% add_absolute_targets(c(1, 1)) %>% 
         add_binary_decisions() %>% add_default_solver(gap = 0) %>% solve() at testthat/test_solve.R:9
  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: function_list[[i]](value)
  8: add_default_solver(., gap = 0)
  9: stop("no optimization problem solvers found on system.")
  
  39. Error: x=SpatialPolygonsDataFrame, y=RasterStack (@test_solve.R#31) --------
  no optimization problem solvers found on system.
  1: problem(costs, spp, cost_column = "cost") %>% add_min_set_objective() %>% add_absolute_targets(c(1, 
         1)) %>% add_binary_decisions() %>% add_default_solver(gap = 0) %>% solve() at testthat/test_solve.R:31
  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: function_list[[i]](value)
  8: add_default_solver(., gap = 0)
  9: stop("no optimization problem solvers found on system.")
  
  40. Error: x=SpatialPolygonsDataFrame, y=character (@test_solve.R#49) ----------
  no optimization problem solvers found on system.
  1: problem(costs, c("spp1", "spp2"), cost_column = "cost") %>% add_min_set_objective() %>% 
         add_absolute_targets(c(1, 1)) %>% add_binary_decisions() %>% add_default_solver(gap = 0) %>% 
         solve() at testthat/test_solve.R:49
  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: function_list[[i]](value)
  8: add_default_solver(., gap = 0)
  9: stop("no optimization problem solvers found on system.")
  
  41. Error: x=data.frame, y=data.frame (@test_solve.R#67) -----------------------
  no optimization problem solvers found on system.
  1: problem(pu, species, rij = rij) %>% add_min_set_objective() %>% add_absolute_targets(c(1, 
         1)) %>% add_binary_decisions() %>% add_default_solver(gap = 0) %>% solve() at testthat/test_solve.R:67
  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: function_list[[i]](value)
  8: add_default_solver(., gap = 0)
  9: stop("no optimization problem solvers found on system.")
  
  42. Error: x=numeric, y=data.frame (@test_solve.R#84) --------------------------
  no optimization problem solvers found on system.
  1: problem(pu$cost, species, rij = rij) %>% add_min_set_objective() %>% add_absolute_targets(c(1, 
         1)) %>% add_binary_decisions() %>% add_default_solver(gap = 0) %>% solve() at testthat/test_solve.R:84
  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: function_list[[i]](value)
  8: add_default_solver(., gap = 0)
  9: stop("no optimization problem solvers found on system.")
  
  testthat results ================================================================
  OK: 495 SKIPPED: 47 FAILED: 42
  1. Error: minimum set objective (compile binary decisions) (@test_add_boundary_penalties.R#11) 
  2. Error: maximum coverage objective (compile binary decisions) (@test_add_boundary_penalties.R#120) 
  3. Error: compile (@test_add_connected_constraints.R#12) 
  4. Error: minimum set objective (compile binary decisions) (@test_add_connectivity_penalties.R#13) 
  5. Error: maximum representation objective (compile binary decisions) (@test_add_connectivity_penalties.R#136) 
  6. Error: compile (@test_add_corridor_constraints.R#24) 
  7. Error: list input (compile) (@test_add_corridor_constraints.R#174) 
  8. Error: compile (@test_add_cuts_portfolio.R#10) 
  9. Error: integer locked in data (compile) (@test_add_locked_in_constraints.R#11) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted