diff --git a/ci/test_wheel_cuopt.sh b/ci/test_wheel_cuopt.sh index d761b27214..dbf25d617e 100755 --- a/ci/test_wheel_cuopt.sh +++ b/ci/test_wheel_cuopt.sh @@ -67,4 +67,6 @@ timeout 30m ./ci/run_cuopt_pytests.sh --verbose --capture=no if [[ "${RAPIDS_BUILD_TYPE}" == "nightly" ]]; then ./ci/thirdparty-testing/run_jump_tests.sh ./ci/thirdparty-testing/run_cvxpy_tests.sh + ./ci/thirdparty-testing/run_pulp_tests.sh + ./ci/thirdparty-testing/run_pyomo_tests.sh fi diff --git a/ci/thirdparty-testing/run_pulp_tests.sh b/ci/thirdparty-testing/run_pulp_tests.sh new file mode 100755 index 0000000000..ac5dc09f95 --- /dev/null +++ b/ci/thirdparty-testing/run_pulp_tests.sh @@ -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" + +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" diff --git a/ci/thirdparty-testing/run_pyomo_tests.sh b/ci/thirdparty-testing/run_pyomo_tests.sh new file mode 100755 index 0000000000..37dd4c088b --- /dev/null +++ b/ci/thirdparty-testing/run_pyomo_tests.sh @@ -0,0 +1,34 @@ +#!/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 '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