Skip to content

Commit

Permalink
Reduce number of excluded tests in MOI_wrapper (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Sep 1, 2022
1 parent 9d706af commit 1d7cc7c
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 24 deletions.
7 changes: 7 additions & 0 deletions src/MOI_wrapper.jl
Expand Up @@ -106,6 +106,13 @@ function MOI.supports_constraint(
(_is_discrete(S) || MOI.supports_constraint(_cont(model), F, S))
end

function MOI.is_valid(
model::Optimizer,
ci::MOI.ConstraintIndex{MOI.VariableIndex,<:MOI.AbstractScalarSet},
)
return MOI.is_valid(_mip(model), ci)
end

function MOI.add_constraint(
model::Optimizer,
func::MOI.VariableIndex,
Expand Down
38 changes: 14 additions & 24 deletions test/MOI_wrapper.jl
Expand Up @@ -33,46 +33,36 @@ function _run_moi_tests(msd::Bool, mip_solver, cont_solver)
MOI.Test.Config(
atol = 1e-4,
rtol = 1e-4,
infeasible_status = MOI.LOCALLY_INFEASIBLE,
optimal_status = MOI.LOCALLY_SOLVED,
exclude = Any[
MOI.ConstraintPrimal,
MOI.ConstraintDual,
MOI.ConstraintBasisStatus,
MOI.DualObjectiveValue,
MOI.NLPBlockDual,
],
),
exclude = String[
# not implemented:
# Not implemented:
"test_attribute_SolverVersion",
# TODO Pavito only returns LOCALLY_INFEASIBLE, not INFEASIBLE:
# see https://github.com/jump-dev/MathOptInterface.jl/issues/1671
"INFEASIBLE",
"test_solve_DualStatus_INFEASIBILITY_CERTIFICATE_",
# invalid model:
# Invalid model:
"test_constraint_ZeroOne_bounds_3",
"test_linear_VectorAffineFunction_empty_row",
# CachingOptimizer does not throw if optimizer not attached:
"test_model_copy_to_UnsupportedAttribute",
"test_model_copy_to_UnsupportedConstraint",
# NLP features not supported:
"test_nonlinear_hs071_NLPBlockDual",
"test_nonlinear_invalid",
# conic mostly unsupported:
# TODO when ConstraintPrimal is fixed, use some conic tests e.g. SOC
# see https://github.com/jump-dev/MathOptInterface.jl/pull/1046
# see https://github.com/jump-dev/MathOptInterface.jl/issues/846
"test_conic",
# TODO ConstraintPrimal not supported, should use a fallback in future:
# see https://github.com/jump-dev/MathOptInterface.jl/issues/1310
"test_solve_result_index",
"test_quadratic_constraint",
"test_quadratic_nonconvex",
"test_quadratic_nonhomogeneous",
"test_linear_integration",
"test_linear_integer",
"test_linear_Semi",
"test_linear_Interval_inactive",
"test_linear_FEASIBILITY_SENSE",
# NORM_LIMIT instead of DUAL_INFEASIBLE
"test_linear_DUAL_INFEASIBLE",
"test_linear_DUAL_INFEASIBLE_2",
"test_solve_TerminationStatus_DUAL_INFEASIBLE",
# ITERATION_LIMIT instead of OPTIMAL
"test_linear_integer_knapsack",
"test_linear_integer_solve_twice",
# INFEASIBLE instead of LOCALLY_INFEASIBLE?
"test_linear_Semicontinuous_integration",
"test_linear_Semiinteger_integration",
],
)
return
Expand Down

0 comments on commit 1d7cc7c

Please sign in to comment.