-
Notifications
You must be signed in to change notification settings - Fork 144
add pulp, pyomo integration tests #945
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| #!/bin/bash | ||
| # SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| set -e -u -o pipefail | ||
|
|
||
| echo "building 'pulp' from source and running cuOpt tests" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Better to use I'd suggest replacing all |
||
|
|
||
| if [ -z "${PIP_CONSTRAINT:-}" ]; then | ||
| echo "PIP_CONSTRAINT is not set; ensure ci/test_wheel_cuopt.sh (or equivalent) has set it so cuopt wheels are used." | ||
| exit 1 | ||
| fi | ||
|
|
||
| git clone --depth 1 https://github.com/coin-or/pulp.git | ||
| pushd ./pulp || exit 1 | ||
|
|
||
| # Install PuLP in editable form so it uses the environment's cuopt (from PIP_CONSTRAINT) | ||
| python -m pip install \ | ||
| --constraint "${PIP_CONSTRAINT}" \ | ||
| --extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple \ | ||
| pytest \ | ||
| -e . | ||
|
|
||
| pip check | ||
|
|
||
| echo "running PuLP tests (cuOpt-related)" | ||
| # PuLP uses pytest; run only tests that reference cuopt/CUOPT | ||
| # Exit code 5 = no tests collected; then try run_tests.py which detects solvers (including cuopt) | ||
| pytest_rc=0 | ||
| timeout 5m python -m pytest \ | ||
| --verbose \ | ||
| --capture=no \ | ||
| -k "cuopt or CUOPT" \ | ||
| pulp/tests/ || pytest_rc=$? | ||
|
|
||
| if [ "$pytest_rc" -eq 5 ]; then | ||
| echo "No pytest -k cuopt tests found; running PuLP run_tests.py (solver auto-detection, includes cuopt)" | ||
| timeout 5m python pulp/tests/run_tests.py | ||
| pytest_rc=$? | ||
| fi | ||
|
|
||
| popd || exit 1 | ||
| exit "$pytest_rc" | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,34 @@ | ||||||
| #!/bin/bash | ||||||
| # SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| # SPDX-License-Identifier: Apache-2.0 | ||||||
|
|
||||||
| set -e -u -o pipefail | ||||||
|
|
||||||
| echo "building 'pyomo' from source and running cuOpt tests" | ||||||
|
|
||||||
| if [ -z "${PIP_CONSTRAINT:-}" ]; then | ||||||
| echo "PIP_CONSTRAINT is not set; ensure ci/test_wheel_cuopt.sh (or equivalent) has set it so cuopt wheels are used." | ||||||
| exit 1 | ||||||
| fi | ||||||
|
|
||||||
| git clone --depth 1 https://github.com/Pyomo/pyomo.git | ||||||
| pushd ./pyomo || exit 1 | ||||||
|
|
||||||
| # Install Pyomo in editable form so it uses the environment's cuopt (from PIP_CONSTRAINT) | ||||||
| python -m pip install \ | ||||||
| --constraint "${PIP_CONSTRAINT}" \ | ||||||
| --extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple \ | ||||||
| pytest \ | ||||||
| -e . | ||||||
|
|
||||||
| pip check | ||||||
|
|
||||||
| echo "running Pyomo tests (cuopt_direct / cuOpt-related)" | ||||||
| # Run only tests that reference cuopt (cuopt_direct solver) | ||||||
| timeout 5m python -m pytest \ | ||||||
| --verbose \ | ||||||
| --capture=no \ | ||||||
| -k "cuopt or CUOPT" \ | ||||||
| pyomo/solvers/tests/ | ||||||
|
|
||||||
| popd || exit 1 | ||||||
coderabbitai[bot] marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.