Skip to content

Commit d01a239

Browse files
committed
Disable some tests that HiGHS can not pass.
Some tests can't be used because HiGHS doesn't support some required feature, eg cut generation, lazy constraints or MIP start. This affects many of the examples (so we exclude all now) and also the tests "rcpsp" and "two_dim_pack". Some others fail because the current version of HiGHS doesn't allow querying the variable type. So we have to keep track of that in the wrapper, which only works when the model is built in Python, but not when read from a file, ie in the tests "mip_files". Finally, some examples yielded a parse error, eg "1443_0-9.lp". Was: Revert "include HiGHS as solvers in other (slow) tests". This (partially) reverts commit 8918708.
1 parent bfbcbea commit d01a239

File tree

5 files changed

+6
-17
lines changed

5 files changed

+6
-17
lines changed

test/examples_test.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,12 @@
88
import importlib.machinery
99
import pytest
1010

11-
import mip.highs
12-
1311

1412
EXAMPLES = glob(join("..", "examples", "*.py")) + glob(join(".", "examples", "*.py"))
1513

1614
SOLVERS = ["cbc"]
1715
if "GUROBI_HOME" in environ:
1816
SOLVERS += ["gurobi"]
19-
if mip.highs.has_highs:
20-
SOLVERS += ["HiGHS"]
2117

2218

2319
@pytest.mark.parametrize("solver, example", product(SOLVERS, EXAMPLES))

test/mip_files_test.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@
77
from itertools import product
88
import pytest
99
import mip
10-
import mip.highs
11-
from mip import Model, OptimizationStatus, GUROBI, CBC, HIGHS
10+
from mip import Model, OptimizationStatus, GUROBI, CBC
1211

1312
# for each MIP in test/data, best lower and upper bounds
1413
# to be used when checking optimization results
@@ -90,8 +89,6 @@
9089
SOLVERS = [CBC]
9190
if "GUROBI_HOME" in environ:
9291
SOLVERS += [GUROBI]
93-
if mip.highs.has_highs:
94-
SOLVERS += [HIGHS]
9592

9693
# check availability of test data
9794
DATA_DIR = join(join(dirname(mip.__file__)[0:-3], "test"), "data")

test/mip_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,9 @@ def test_tsp_cuts(solver: str):
383383
assert abs(m.objective_value - 262) <= TOL # "mip model objective"
384384

385385

386-
@pytest.mark.parametrize("solver", SOLVERS)
386+
# Exclude HiGHS solver, which doesn't support MIP start.
387+
SOLVERS_WITH_MIPSTART = [s for s in SOLVERS if s != HIGHS]
388+
@pytest.mark.parametrize("solver", SOLVERS_WITH_MIPSTART)
387389
def test_tsp_mipstart(solver: str):
388390
"""tsp related tests"""
389391
N = ["a", "b", "c", "d", "e", "f", "g"]

test/rcpsp_test.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
import json
66
from itertools import product
77
import pytest
8-
import mip.highs
9-
from mip import CBC, GUROBI, HIGHS, OptimizationStatus
8+
from mip import CBC, GUROBI, OptimizationStatus
109
from mip_rcpsp import create_mip
1110

1211
INSTS = glob("./data/rcpsp*.json") + glob("./test/data/rcpsp*.json")
@@ -16,8 +15,6 @@
1615
SOLVERS = [CBC]
1716
if "GUROBI_HOME" in environ:
1817
SOLVERS += [GUROBI]
19-
if mip.highs.has_highs:
20-
SOLVERS += [HIGHS]
2118

2219

2320
@pytest.mark.parametrize("solver, instance", product(SOLVERS, INSTS))

test/two_dim_pack_test.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
import json
66
from itertools import product
77
import pytest
8-
import mip.highs
9-
from mip import CBC, GUROBI, HIGHS, OptimizationStatus
8+
from mip import CBC, GUROBI, OptimizationStatus
109
from mip_2d_pack import create_mip
1110

1211
INSTS = glob("./data/two_dim_pack_p*.json") + glob(
@@ -18,8 +17,6 @@
1817
SOLVERS = [CBC]
1918
if "GUROBI_HOME" in environ:
2019
SOLVERS += [GUROBI]
21-
if mip.highs.has_highs:
22-
SOLVERS += [HIGHS]
2320

2421

2522
@pytest.mark.parametrize("solver, instance", product(SOLVERS, INSTS))

0 commit comments

Comments
 (0)