-
Notifications
You must be signed in to change notification settings - Fork 2.3k
math_opt: only run SCIP tests if enabled #4745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Usage of SCIP library can be disabled in CMake build by setting -DUSE_SCIP=OFF. However, the tests were still run unconditionally, showing test failures like this: ``` /build/source/ortools/math_opt/solver_tests/test_models_test.cc:29: Failure Value of: Solve(*model, SolverType::kGscip) Expected: is OK and has a value that (is an object whose field `termination` (is an object whose field `reason` is equal to optimal) and (is an object whose field `problem_status` (is an object whose field `primal_status` is equal to feasible) and (is an object whose field `dual_status` is equal to feasible) and (is an object whose field `primal_or_dual_infeasible` is equal to false))) and (is an object whose property `has_primal_feasible_solution` is equal to true) and (is an object whose property `objective_value` is approximately 9 (absolute error <= 1.0000000000000001e-05)) Actual: [INVALID_ARGUMENT: solver type SOLVER_TYPE_GSCIP is not registered, support for this solver has not been compiled], which has status INVALID_ARGUMENT: solver type SOLVER_TYPE_GSCIP is not registered, support for this solver has not been compiled [ FAILED ] SmallModelTest.Integer (2 ms) [ RUN ] SmallModelTest.Continuous [ OK ] SmallModelTest.Continuous (1 ms) [----------] 2 tests from SmallModelTest (3 ms total) [----------] 2 tests from DenseIndependentSetTest [ RUN ] DenseIndependentSetTest.Integer /build/source/ortools/math_opt/solver_tests/test_models_test.cc:40: Failure Value of: Solve(*model, SolverType::kGscip) Expected: is OK and has a value that (is an object whose field `termination` (is an object whose field `reason` is equal to optimal) and (is an object whose field `problem_status` (is an object whose field `primal_status` is equal to feasible) and (is an object whose field `dual_status` is equal to feasible) and (is an object whose field `primal_or_dual_infeasible` is equal to false))) and (is an object whose property `has_primal_feasible_solution` is equal to true) and (is an object whose property `objective_value` is approximately 7 (absolute error <= 1.0000000000000001e-05)) Actual: [INVALID_ARGUMENT: solver type SOLVER_TYPE_GSCIP is not registered, support for this solver has not been compiled], which has status INVALID_ARGUMENT: solver type SOLVER_TYPE_GSCIP is not registered, support for this solver has not been compiled [ FAILED ] DenseIndependentSetTest.Integer (0 ms) [ RUN ] DenseIndependentSetTest.Continuous [ OK ] DenseIndependentSetTest.Continuous (1 ms) [----------] 2 tests from DenseIndependentSetTest (2 ms total) [----------] 1 test from DenseIndependentSetHint5Test [ RUN ] DenseIndependentSetHint5Test.HintIsFeasibleWithObjective5 /build/source/ortools/math_opt/solver_tests/test_models_test.cc:59: Failure Value of: Solve(*model, SolverType::kGscip) Expected: is OK and has a value that (is an object whose field `termination` (is an object whose field `reason` is equal to optimal) and (is an object whose field `problem_status` (is an object whose field `primal_status` is equal to feasible) and (is an object whose field `dual_status` is equal to feasible) and (is an object whose field `primal_or_dual_infeasible` is equal to false))) and (is an object whose property `has_primal_feasible_solution` is equal to true) and (is an object whose property `objective_value` is approximately 5 (absolute error <= 1.0000000000000001e-05)) Actual: [INVALID_ARGUMENT: solver type SOLVER_TYPE_GSCIP is not registered, support for this solver has not been compiled], which has status INVALID_ARGUMENT: solver type SOLVER_TYPE_GSCIP is not registered, support for this solver has not been compiled [ FAILED ] DenseIndependentSetHint5Test.HintIsFeasibleWithObjective5 (0 ms) [----------] 1 test from DenseIndependentSetHint5Test (0 ms total) [----------] 2 tests from IndependentSetCompleteGraphTest [ RUN ] IndependentSetCompleteGraphTest.Integer /build/source/ortools/math_opt/solver_tests/test_models_test.cc:65: Failure Value of: Solve(*model, SolverType::kGscip) Expected: is OK and has a value that (is an object whose field `termination` (is an object whose field `reason` is equal to optimal) and (is an object whose field `problem_status` (is an object whose field `primal_status` is equal to feasible) and (is an object whose field `dual_status` is equal to feasible) and (is an object whose field `primal_or_dual_infeasible` is equal to false))) and (is an object whose property `has_primal_feasible_solution` is equal to true) and (is an object whose property `objective_value` is approximately 1 (absolute error <= 1.0000000000000001e-05)) Actual: [INVALID_ARGUMENT: solver type SOLVER_TYPE_GSCIP is not registered, support for this solver has not been compiled], which has status INVALID_ARGUMENT: solver type SOLVER_TYPE_GSCIP is not registered, support for this solver has not been compiled [ FAILED ] IndependentSetCompleteGraphTest.Integer (0 ms) ``` Fix this, by conditionalizing these tests on USE_SCIP.
13 tasks
flokli
added a commit
to flokli/nixpkgs
that referenced
this pull request
Aug 18, 2025
This needs google/or-tools#4745 to skip SCIP tests if built without SCIP (which we currently do). The tests currently still fail on aarch64-linux (google/or-tools#4746), so we only enable for x86_64-linux. It can be re-tested with a more recent version once or-tools is updated.
MultisampledNight
pushed a commit
to MultisampledNight/nixpkgs
that referenced
this pull request
Aug 20, 2025
This needs google/or-tools#4745 to skip SCIP tests if built without SCIP (which we currently do). The tests currently still fail on aarch64-linux (google/or-tools#4746), so we only enable for x86_64-linux. It can be re-tested with a more recent version once or-tools is updated.
13 tasks
flokli
added a commit
to flokli/nixpkgs
that referenced
this pull request
Oct 8, 2025
This adds a new argument, withScip, defaulting to true, which will configure or-tools with SCIP support. or-tools usually is built with SCIP support, and only tested like this, see google/or-tools#4745. However, SCIP only was introduced to nixpkgs March 2025, that's probably why or-tools in nixpkgs came without it so far. If built with SCIP support, we need to propagate scip itself, otherwise downstream cmake consumers need to set SCIP_ROOT explicitly.
work-jdannenberg
pushed a commit
to work-jdannenberg/nixpkgs
that referenced
this pull request
Oct 10, 2025
This adds a new argument, withScip, defaulting to true, which will configure or-tools with SCIP support. or-tools usually is built with SCIP support, and only tested like this, see google/or-tools#4745. However, SCIP only was introduced to nixpkgs March 2025, that's probably why or-tools in nixpkgs came without it so far. If built with SCIP support, we need to propagate scip itself, otherwise downstream cmake consumers need to set SCIP_ROOT explicitly.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Usage of SCIP library can be disabled in CMake build by setting -DUSE_SCIP=OFF.
However, the tests were still run unconditionally, showing test failures like this:
Fix this, by conditionalizing these tests on USE_SCIP.