-
Notifications
You must be signed in to change notification settings - Fork 165
Expand file tree
/
Copy pathtest_python.sh
More file actions
executable file
·85 lines (65 loc) · 2.56 KB
/
test_python.sh
File metadata and controls
executable file
·85 lines (65 loc) · 2.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/bin/bash
# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
set -euo pipefail
# shellcheck source=ci/utils/cuopt_coredumps.sh
source "$(dirname "${BASH_SOURCE[0]}")/utils/cuopt_coredumps.sh"
cuopt_coredumps_ci_setup
. /opt/conda/etc/profile.d/conda.sh
rapids-logger "Configuring conda strict channel priority"
conda config --set channel_priority strict
rapids-logger "Downloading artifacts from previous jobs"
CPP_CHANNEL=$(rapids-download-conda-from-github cpp)
PYTHON_CHANNEL=$(rapids-download-conda-from-github python)
rapids-logger "Generate Python testing dependencies"
rapids-dependency-file-generator \
--output conda \
--file-key test_python \
--prepend-channel "${CPP_CHANNEL}" \
--prepend-channel "${PYTHON_CHANNEL}" \
--matrix "cuda=${RAPIDS_CUDA_VERSION%.*};arch=$(arch);py=${RAPIDS_PY_VERSION}" | tee env.yaml
rapids-mamba-retry env create --yes -f env.yaml -n test
# Temporarily allow unbound variables for conda activation.
set +u
conda activate test
set -u
RAPIDS_TESTS_DIR=${RAPIDS_TESTS_DIR:-"${PWD}/test-results"}
RAPIDS_COVERAGE_DIR=${RAPIDS_COVERAGE_DIR:-"${PWD}/coverage-results"}
mkdir -p "${RAPIDS_TESTS_DIR}" "${RAPIDS_COVERAGE_DIR}"
rapids-print-env
rapids-logger "Download datasets"
RAPIDS_DATASET_ROOT_DIR="$(realpath datasets)"
export RAPIDS_DATASET_ROOT_DIR
./datasets/linear_programming/download_pdlp_test_dataset.sh
./datasets/mip/download_miplib_test_dataset.sh
pushd "${RAPIDS_DATASET_ROOT_DIR}"
./get_test_data.sh
popd
rapids-logger "Check GPU usage"
nvidia-smi
EXITCODE=0
trap "EXITCODE=1" ERR
set +e
# 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-logger "Test cuopt_cli"
timeout 10m bash ./python/libcuopt/libcuopt/tests/test_cli.sh
rapids-logger "pytest cuopt"
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
rapids-logger "pytest cuopt-server"
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
rapids-logger "Test skills/ assets (Python, C, CLI)"
timeout 10m ./ci/test_skills_assets.sh
rapids-logger "Test script exiting with value: $EXITCODE"
exit ${EXITCODE}