Running ‘testthat.R’
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(magrittr)
  
  Attaching package: 'magrittr'
  
  The following objects are masked from 'package:testthat':
  
      equals, is_less_than, not
  
  > library(ROI)
  ROI.plugin.symphony: R Optimization Infrastructure
  Registered solver plugins: nlminb, glpk.
  Default solver: auto.
  > library(ROI.plugin.glpk)
  > library(ompr)
  > library(ompr.roi)
  > test_check("ompr.roi")
  1. Error: ROI correctly flags an unbounded problem (@test-solver-roi.R#17) -----
  no applicable method for 'as.L_term' applied to an object of class "c('dsparseVector', 'sparseVector', 'xsparseVector', 'replValueSp')"
  1: add_variable(MIPModel(), x, type = "continuous") %>% set_objective(x, sense = "max") %>% 
         add_constraint(x >= 0) %>% solve_model(with_ROI(solver = "glpk")) at testthat/test-solver-roi.R:17
  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: solve_model(., with_ROI(solver = "glpk"))
  10: solve_model.optimization_model(., with_ROI(solver = "glpk"))
  11: solver(model)
  12: ROI::L_objective(obj_vector)
  13: Q_objective(Q = NULL, L = L, names = names)
  14: as.L_term(L, nrow = 1L, ncol = ncol(Q))
  
  2. Error: ROI correctly flags an infeasible problem (@test-solver-roi.R#25) ----
  no applicable method for 'as.L_term' applied to an object of class "c('dsparseVector', 'sparseVector', 'xsparseVector', 'replValueSp')"
  1: add_variable(MIPModel(), x, type = "continuous", lb = 10) %>% set_objective(x, sense = "max") %>% 
         add_constraint(x <= 3) %>% solve_model(with_ROI(solver = "glpk")) at testthat/test-solver-roi.R:25
  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: solve_model(., with_ROI(solver = "glpk"))
  10: solve_model.optimization_model(., with_ROI(solver = "glpk"))
  11: solver(model)
  12: ROI::L_objective(obj_vector)
  13: Q_objective(Q = NULL, L = L, names = names)
  14: as.L_term(L, nrow = 1L, ncol = ncol(Q))
  
  3. Error: ROI has a verbose option (@test-solver-roi.R#36) ---------------------
  no applicable method for 'as.L_term' applied to an object of class "c('dsparseVector', 'sparseVector', 'xsparseVector', 'replValueSp')"
  1: expect_output(solve_model(m, with_ROI(solver = "glpk", verbose = TRUE))) at testthat/test-solver-roi.R:36
  2: capture_output(object)
  3: capture_output_as_vector(code, print)
  4: with_sink(temp, withVisible(code))
  5: withVisible(code)
  6: solve_model(m, with_ROI(solver = "glpk", verbose = TRUE))
  7: solve_model.optimization_model(m, with_ROI(solver = "glpk", verbose = TRUE))
  8: solver(model)
  9: ROI::L_objective(obj_vector)
  10: Q_objective(Q = NULL, L = L, names = names)
  11: as.L_term(L, nrow = 1L, ncol = ncol(Q))
  
  4. Error: ROI interprets obj. max sense correctly (@test-solver-roi.R#40) ------
  no applicable method for 'as.L_term' applied to an object of class "c('dsparseVector', 'sparseVector', 'xsparseVector', 'replValueSp')"
  1: add_variable(MIPModel(), x, type = "continuous", ub = 10) %>% set_objective(x, sense = "max") %>% 
         add_constraint(x <= 80) %>% solve_model(with_ROI(solver = "glpk")) at testthat/test-solver-roi.R:40
  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: solve_model(., with_ROI(solver = "glpk"))
  10: solve_model.optimization_model(., with_ROI(solver = "glpk"))
  11: solver(model)
  12: ROI::L_objective(obj_vector)
  13: Q_objective(Q = NULL, L = L, names = names)
  14: as.L_term(L, nrow = 1L, ncol = ncol(Q))
  
  5. Error: ROI interprets obj. min sense correctly (@test-solver-roi.R#49) ------
  no applicable method for 'as.L_term' applied to an object of class "c('dsparseVector', 'sparseVector', 'xsparseVector', 'replValueSp')"
  1: add_variable(MIPModel(), x, type = "continuous", lb = 10) %>% set_objective(x, sense = "min") %>% 
         add_constraint(x >= 0) %>% solve_model(with_ROI(solver = "glpk")) at testthat/test-solver-roi.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: withVisible(function_list[[k]](value))
  8: function_list[[k]](value)
  9: solve_model(., with_ROI(solver = "glpk"))
  10: solve_model.optimization_model(., with_ROI(solver = "glpk"))
  11: solver(model)
  12: ROI::L_objective(obj_vector)
  13: Q_objective(Q = NULL, L = L, names = names)
  14: as.L_term(L, nrow = 1L, ncol = ncol(Q))
  
  6. Error: symphony can solve a model (@test-solver-roi.R#58) -------------------
  no applicable method for 'as.L_term' applied to an object of class "c('dsparseVector', 'sparseVector', 'xsparseVector', 'replValueSp')"
  1: add_variable(MIPModel(), x[i], i = 1:3, type = "binary") %>% add_constraint(sum_expr(x[i], 
         i = 1:3) == 1) %>% set_objective(sum_expr(x[i] * weights[i], i = 1:3) + 5) %>% 
         solve_model(with_ROI(solver = "glpk")) at testthat/test-solver-roi.R:58
  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: solve_model(., with_ROI(solver = "glpk"))
  10: solve_model.optimization_model(., with_ROI(solver = "glpk"))
  11: solver(model)
  12: ROI::L_objective(obj_vector)
  13: Q_objective(Q = NULL, L = L, names = names)
  14: as.L_term(L, nrow = 1L, ncol = ncol(Q))
  
  7. Error: ROI can solve a bin packing problem (@test-solver-roi.R#82) ----------
  no applicable method for 'as.L_term' applied to an object of class "c('dsparseVector', 'sparseVector', 'xsparseVector', 'replValueSp')"
  1: solve_model(m, with_ROI(solver = "glpk")) at testthat/test-solver-roi.R:82
  2: solve_model.optimization_model(m, with_ROI(solver = "glpk"))
  3: solver(model)
  4: ROI::L_objective(obj_vector)
  5: Q_objective(Q = NULL, L = L, names = names)
  6: as.L_term(L, nrow = 1L, ncol = ncol(Q))
  
  8. Error: quantified constraints work (@test-solver-roi.R#99) ------------------
  no applicable method for 'as.L_term' applied to an object of class "c('dsparseVector', 'sparseVector', 'xsparseVector', 'replValueSp')"
  1: solve_model(m, with_ROI(solver = "glpk")) at testthat/test-solver-roi.R:99
  2: solve_model.optimization_model(m, with_ROI(solver = "glpk"))
  3: solver(model)
  4: ROI::L_objective(obj_vector)
  5: Q_objective(Q = NULL, L = L, names = names)
  6: as.L_term(L, nrow = 1L, ncol = ncol(Q))
  
  9. Error: bug 20160704: did not correctly convert constraint (@test-solver-roi.R#105) 
  no applicable method for 'as.L_term' applied to an object of class "c('dsparseVector', 'sparseVector', 'xsparseVector', 'replValueSp')"
  1: MIPModel() %>% add_variable(x[i, j], i = 1:n, j = 1:n, type = "binary") %>% add_variable(u[i], 
         i = 1:n, lb = 1, ub = n) %>% set_objective(0) %>% add_constraint(u[i] + 1 <= 
         u[j] + n * (1 - x[i, j]), i = 1:n, j = 1:n) %>% solve_model(with_ROI(solver = "glpk")) at testthat/test-solver-roi.R:105
  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: solve_model(., with_ROI(solver = "glpk"))
  10: solve_model.optimization_model(., with_ROI(solver = "glpk"))
  11: solver(model)
  12: ROI::L_objective(obj_vector)
  13: Q_objective(Q = NULL, L = L, names = names)
  14: as.L_term(L, nrow = 1L, ncol = ncol(Q))
  
  10. Error: can solve a model with variable bounds (@test-solver-roi.R#116) -----
  no applicable method for 'as.L_term' applied to an object of class "c('dsparseVector', 'sparseVector', 'xsparseVector', 'replValueSp')"
  1: MIPModel() %>% add_variable(x[i, j], i = 1:n, j = 1:n, type = "integer", lb = 0, 
         ub = 1) %>% set_bounds(x[i, j], i = 1:n, j = 1:n, lb = 0, ub = 0) %>% set_objective(sum_expr(x[i, 
         j], i = 1:n, j = 1:n)) %>% add_constraint(sum_expr(x[i, j], i = 1:n, j = 1:n) <= 
         10) %>% solve_model(with_ROI(solver = "glpk")) at testthat/test-solver-roi.R:116
  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: solve_model(., with_ROI(solver = "glpk"))
  10: solve_model.optimization_model(., with_ROI(solver = "glpk"))
  11: solver(model)
  12: ROI::L_objective(obj_vector)
  13: Q_objective(Q = NULL, L = L, names = names)
  14: as.L_term(L, nrow = 1L, ncol = ncol(Q))
  
  11. Error: bug 20161006 #75: warning messge when setting bound on single var (@test-solver-roi.R#130) 
  no applicable method for 'as.L_term' applied to an object of class "c('dsparseVector', 'sparseVector', 'xsparseVector', 'replValueSp')"
  1: expect_silent({
         MIPModel() %>% add_variable(x, type = "integer") %>% add_variable(y, type = "continuous", 
             lb = 0) %>% set_bounds(x, lb = 0) %>% set_objective(x + y, "max") %>% add_constraint(x + 
             y <= 11.25) %>% solve_model(with_ROI(solver = "glpk"))
     }) at testthat/test-solver-roi.R:130
  2: evaluate_promise(object)
  3: with_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  4: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  5: withVisible(code)
  6: MIPModel() %>% add_variable(x, type = "integer") %>% add_variable(y, type = "continuous", 
         lb = 0) %>% set_bounds(x, lb = 0) %>% set_objective(x + y, "max") %>% add_constraint(x + 
         y <= 11.25) %>% solve_model(with_ROI(solver = "glpk")) at testthat/test-solver-roi.R:131
  7: withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  8: eval(quote(`_fseq`(`_lhs`)), env, env)
  9: eval(quote(`_fseq`(`_lhs`)), env, env)
  10: `_fseq`(`_lhs`)
  11: freduce(value, `_function_list`)
  12: withVisible(function_list[[k]](value))
  13: function_list[[k]](value)
  14: solve_model(., with_ROI(solver = "glpk"))
  15: solve_model.optimization_model(., with_ROI(solver = "glpk"))
  16: solver(model)
  17: ROI::L_objective(obj_vector)
  18: Q_objective(Q = NULL, L = L, names = names)
  19: as.L_term(L, nrow = 1L, ncol = ncol(Q))
  
  12. Error: bug 20161011 #82: problems with bound indexes (@test-solver-roi.R#148) 
  no applicable method for 'as.L_term' applied to an object of class "c('dsparseVector', 'sparseVector', 'xsparseVector', 'replValueSp')"
  1: solve_model(model, with_ROI("glpk")) at testthat/test-solver-roi.R:148
  2: solve_model.optimization_model(model, with_ROI("glpk"))
  3: solver(model)
  4: ROI::L_objective(obj_vector)
  5: Q_objective(Q = NULL, L = L, names = names)
  6: as.L_term(L, nrow = 1L, ncol = ncol(Q))
  
  13. Error: bug 20161116 #107: it works with no objective function (@test-solver-roi.R#154) 
  no applicable method for 'as.L_term' applied to an object of class "c('isparseVector', 'sparseVector', 'xsparseVector', 'replValueSp')"
  1: solve_model(model, with_ROI("glpk")) at testthat/test-solver-roi.R:154
  2: solve_model.optimization_model(model, with_ROI("glpk"))
  3: solver(model)
  4: ROI::L_objective(obj_vector)
  5: Q_objective(Q = NULL, L = L, names = names)
  6: as.L_term(L, nrow = 1L, ncol = ncol(Q))
  
  14. Error: bug 20161031 #102: model with no constraint crashes (@test-solver-roi.R#163) 
  no applicable method for 'as.L_term' applied to an object of class "c('dsparseVector', 'sparseVector', 'xsparseVector', 'replValueSp')"
  1: expect_silent(result <- solve_model(model, with_ROI("glpk"))) at testthat/test-solver-roi.R:163
  2: evaluate_promise(object)
  3: with_sink(temp, withCallingHandlers(withVisible(code), warning = handle_warning, 
         message = handle_message))
  4: withCallingHandlers(withVisible(code), warning = handle_warning, message = handle_message)
  5: withVisible(code)
  6: solve_model(model, with_ROI("glpk"))
  7: solve_model.optimization_model(model, with_ROI("glpk"))
  8: solver(model)
  9: ROI::L_objective(obj_vector)
  10: Q_objective(Q = NULL, L = L, names = names)
  11: as.L_term(L, nrow = 1L, ncol = ncol(Q))
  
  testthat results ================================================================
  OK: 2 SKIPPED: 0 FAILED: 14
  1. Error: ROI correctly flags an unbounded problem (@test-solver-roi.R#17) 
  2. Error: ROI correctly flags an infeasible problem (@test-solver-roi.R#25) 
  3. Error: ROI has a verbose option (@test-solver-roi.R#36) 
  4. Error: ROI interprets obj. max sense correctly (@test-solver-roi.R#40) 
  5. Error: ROI interprets obj. min sense correctly (@test-solver-roi.R#49) 
  6. Error: symphony can solve a model (@test-solver-roi.R#58) 
  7. Error: ROI can solve a bin packing problem (@test-solver-roi.R#82) 
  8. Error: quantified constraints work (@test-solver-roi.R#99) 
  9. Error: bug 20160704: did not correctly convert constraint (@test-solver-roi.R#105) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted