File tree Expand file tree Collapse file tree 7 files changed +62
-19
lines changed
Expand file tree Collapse file tree 7 files changed +62
-19
lines changed Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3+ # SPDX-License-Identifier: Apache-2.0
4+
5+ set -euo pipefail
6+
7+ # Support customizing the gtests' install location
8+ # First, try the installed location (CI/conda environments)
9+ installed_test_location=" ${INSTALL_PREFIX:- ${CONDA_PREFIX:-/ usr} } /bin/gtests/libcuopt/"
10+ # Fall back to the build directory (devcontainer environments)
11+ devcontainers_test_location=" $( dirname " $( realpath " ${BASH_SOURCE[0]} " ) " ) /../cpp/build/latest/gtests/libcuopt/"
12+
13+ if [[ -d " ${installed_test_location} " ]]; then
14+ GTEST_DIR=" ${installed_test_location} "
15+ elif [[ -d " ${devcontainers_test_location} " ]]; then
16+ GTEST_DIR=" ${devcontainers_test_location} "
17+ else
18+ echo " Error: Test location not found. Searched:" >&2
19+ echo " - ${installed_test_location} " >&2
20+ echo " - ${devcontainers_test_location} " >&2
21+ exit 1
22+ fi
23+
24+ for gt in " ${GTEST_DIR} " /* _TEST; do
25+ test_name=$( basename " ${gt} " )
26+ echo " Running gtest ${test_name} "
27+ " ${gt} " " $@ "
28+ done
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3+ # SPDX-License-Identifier: Apache-2.0
4+
5+ set -euo pipefail
6+
7+ # It is essential to cd into python/cuopt/cuopt as `pytest-xdist` + `coverage` seem to work only at this directory level.
8+
9+ # Support invoking run_cuopt_pytests.sh outside the script directory
10+ cd " $( dirname " $( realpath " ${BASH_SOURCE[0]} " ) " ) " /../python/cuopt/cuopt/
11+
12+ pytest --cache-clear " $@ " tests
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3+ # SPDX-License-Identifier: Apache-2.0
4+
5+ set -euo pipefail
6+
7+ # It is essential to cd into python/cuopt_server/cuopt_server as `pytest-xdist` + `coverage` seem to work only at this directory level.
8+
9+ # Support invoking run_cuopt_server_pytests.sh outside the script directory
10+ cd " $( dirname " $( realpath " ${BASH_SOURCE[0]} " ) " ) " /../python/cuopt_server/cuopt_server/
11+
12+ pytest --cache-clear " $@ " tests
Original file line number Diff line number Diff line change @@ -48,12 +48,11 @@ EXITCODE=0
4848trap " EXITCODE=1" ERR
4949set +e
5050
51+ # Run gtests from libcuopt-tests package
52+ export GTEST_OUTPUT=xml:${RAPIDS_TESTS_DIR} /
53+
5154rapids-logger " Run gtests"
52- for gt in " $CONDA_PREFIX " /bin/gtests/libcuopt/* _TEST ; do
53- test_name=$( basename " ${gt} " )
54- echo " Running gtest $test_name "
55- timeout 20m " ${gt} " --gtest_output=xml:" {RAPIDS_TESTS_DIR}"
56- done
55+ timeout 40m ./ci/run_ctests.sh
5756
5857rapids-logger " Test script exiting with value: $EXITCODE "
5958exit ${EXITCODE}
Original file line number Diff line number Diff line change @@ -58,29 +58,21 @@ rapids-logger "Test cuopt_cli"
5858timeout 10m bash ./python/libcuopt/libcuopt/tests/test_cli.sh
5959
6060rapids-logger " pytest cuopt"
61- pushd python/cuopt/cuopt
62- timeout 30m pytest \
63- --cache-clear \
61+ timeout 30m ./ci/run_cuopt_pytests.sh \
6462 --junitxml=" ${RAPIDS_TESTS_DIR} /junit-cuopt.xml" \
6563 --cov-config=.coveragerc \
6664 --cov=cuopt \
6765 --cov-report=xml:" ${RAPIDS_COVERAGE_DIR} /cuopt-coverage.xml" \
6866 --cov-report=term \
69- --ignore=raft \
70- tests
71- popd
67+ --ignore=raft
7268
7369rapids-logger " pytest cuopt-server"
74- pushd python/cuopt_server/cuopt_server
75- timeout 20m pytest \
76- --cache-clear \
70+ timeout 20m ./ci/run_cuopt_server_pytests.sh \
7771 --junitxml=" ${RAPIDS_TESTS_DIR} /junit-cuopt-server.xml" \
7872 --cov-config=.coveragerc \
7973 --cov=cuopt_server \
8074 --cov-report=xml:" ${RAPIDS_COVERAGE_DIR} /cuopt-server-coverage.xml" \
81- --cov-report=term \
82- tests
83- popd
75+ --cov-report=term
8476
8577rapids-logger " Test script exiting with value: $EXITCODE "
8678exit ${EXITCODE}
Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ timeout 10m bash ./python/libcuopt/libcuopt/tests/test_cli.sh
6262# Due to race condition in certain cases UCX might not be able to cleanup properly, so we set the number of threads to 1
6363export OMP_NUM_THREADS=1
6464
65- RAPIDS_DATASET_ROOT_DIR=./datasets timeout 30m python -m pytest -- verbose --capture=no ./python/cuopt/cuopt/tests/
65+ timeout 30m ./ci/run_cuopt_pytests.sh -- verbose --capture=no
6666
6767# run thirdparty integration tests for only nightly builds
6868if [[ " ${RAPIDS_BUILD_TYPE} " == " nightly" ]]; then
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ rapids-pip-retry install \
2828./datasets/mip/download_miplib_test_dataset.sh
2929
3030
31- RAPIDS_DATASET_ROOT_DIR=./datasets timeout 30m python -m pytest -- verbose --capture=no ./python/cuopt_server/cuopt_server/tests/
31+ timeout 30m ./ci/run_cuopt_server_pytests.sh -- verbose --capture=no
3232
3333# Run documentation tests
3434./ci/test_doc_examples.sh
You can’t perform that action at this time.
0 commit comments