Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions ci/run_ctests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

set -euo pipefail

# Support customizing the gtests' install location
# First, try the installed location (CI/conda environments)
installed_test_location="${INSTALL_PREFIX:-${CONDA_PREFIX:-/usr}}/bin/gtests/libcuopt/"
# Fall back to the build directory (devcontainer environments)
devcontainers_test_location="$(dirname "$(realpath "${BASH_SOURCE[0]}")")/../cpp/build/latest/gtests/libcuopt/"

if [[ -d "${installed_test_location}" ]]; then
GTEST_DIR="${installed_test_location}"
elif [[ -d "${devcontainers_test_location}" ]]; then
GTEST_DIR="${devcontainers_test_location}"
else
echo "Error: Test location not found. Searched:" >&2
echo " - ${installed_test_location}" >&2
echo " - ${devcontainers_test_location}" >&2
exit 1
fi

for gt in "${GTEST_DIR}"/*_TEST; do
test_name=$(basename "${gt}")
echo "Running gtest ${test_name}"
"${gt}" "$@"
done
12 changes: 12 additions & 0 deletions ci/run_cuopt_pytests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

set -euo pipefail

# It is essential to cd into python/cuopt/cuopt as `pytest-xdist` + `coverage` seem to work only at this directory level.

# Support invoking run_cuopt_pytests.sh outside the script directory
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/cuopt/cuopt/

pytest --cache-clear "$@" tests
12 changes: 12 additions & 0 deletions ci/run_cuopt_server_pytests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

set -euo pipefail

# It is essential to cd into python/cuopt_server/cuopt_server as `pytest-xdist` + `coverage` seem to work only at this directory level.

# Support invoking run_cuopt_server_pytests.sh outside the script directory
cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/cuopt_server/cuopt_server/

pytest --cache-clear "$@" tests
9 changes: 4 additions & 5 deletions ci/test_cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,11 @@ EXITCODE=0
trap "EXITCODE=1" ERR
set +e

# Run gtests from libcuopt-tests package
export GTEST_OUTPUT=xml:${RAPIDS_TESTS_DIR}/

rapids-logger "Run gtests"
for gt in "$CONDA_PREFIX"/bin/gtests/libcuopt/*_TEST ; do
test_name=$(basename "${gt}")
echo "Running gtest $test_name"
timeout 20m "${gt}" --gtest_output=xml:"{RAPIDS_TESTS_DIR}"
done
timeout 40m ./ci/run_ctests.sh

rapids-logger "Test script exiting with value: $EXITCODE"
exit ${EXITCODE}
16 changes: 4 additions & 12 deletions ci/test_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,29 +58,21 @@ rapids-logger "Test cuopt_cli"
timeout 10m bash ./python/libcuopt/libcuopt/tests/test_cli.sh

rapids-logger "pytest cuopt"
pushd python/cuopt/cuopt
timeout 30m pytest \
--cache-clear \
timeout 30m ./ci/run_cuopt_pytests.sh \
--junitxml="${RAPIDS_TESTS_DIR}/junit-cuopt.xml" \
--cov-config=.coveragerc \
--cov=cuopt \
--cov-report=xml:"${RAPIDS_COVERAGE_DIR}/cuopt-coverage.xml" \
--cov-report=term \
--ignore=raft \
tests
popd
--ignore=raft

rapids-logger "pytest cuopt-server"
pushd python/cuopt_server/cuopt_server
timeout 20m pytest \
--cache-clear \
timeout 20m ./ci/run_cuopt_server_pytests.sh \
--junitxml="${RAPIDS_TESTS_DIR}/junit-cuopt-server.xml" \
--cov-config=.coveragerc \
--cov=cuopt_server \
--cov-report=xml:"${RAPIDS_COVERAGE_DIR}/cuopt-server-coverage.xml" \
--cov-report=term \
tests
popd
--cov-report=term

rapids-logger "Test script exiting with value: $EXITCODE"
exit ${EXITCODE}
2 changes: 1 addition & 1 deletion ci/test_wheel_cuopt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ timeout 10m bash ./python/libcuopt/libcuopt/tests/test_cli.sh
# Due to race condition in certain cases UCX might not be able to cleanup properly, so we set the number of threads to 1
export OMP_NUM_THREADS=1

RAPIDS_DATASET_ROOT_DIR=./datasets timeout 30m python -m pytest --verbose --capture=no ./python/cuopt/cuopt/tests/
timeout 30m ./ci/run_cuopt_pytests.sh --verbose --capture=no

# run thirdparty integration tests for only nightly builds
if [[ "${RAPIDS_BUILD_TYPE}" == "nightly" ]]; then
Expand Down
4 changes: 3 additions & 1 deletion ci/test_wheel_cuopt_server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,10 @@ rapids-pip-retry install \
./datasets/linear_programming/download_pdlp_test_dataset.sh
./datasets/mip/download_miplib_test_dataset.sh

RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)"
export RAPIDS_DATASET_ROOT_DIR

RAPIDS_DATASET_ROOT_DIR=./datasets timeout 30m python -m pytest --verbose --capture=no ./python/cuopt_server/cuopt_server/tests/
timeout 30m ./ci/run_cuopt_server_pytests.sh --verbose --capture=no

# Run documentation tests
./ci/test_doc_examples.sh