diff --git a/ci/run_ctests.sh b/ci/run_ctests.sh new file mode 100755 index 0000000000..069490facf --- /dev/null +++ b/ci/run_ctests.sh @@ -0,0 +1,10 @@ +#!/bin/bash +# Copyright (c) 2024, NVIDIA CORPORATION. + +set -euo pipefail + +# Support customizing the ctests' install location +cd "${INSTALL_PREFIX:-${CONDA_PREFIX:-/usr}}/bin/tests/libkvikio/" + +# Run BASIC_IO_TEST +./BASIC_IO_TEST diff --git a/ci/run_pytests.sh b/ci/run_pytests.sh new file mode 100755 index 0000000000..73de68d03b --- /dev/null +++ b/ci/run_pytests.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# Copyright (c) 2024, NVIDIA CORPORATION. + +set -euo pipefail + +# Support invoking run_pytests.sh outside the script directory +cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/ + +pytest --cache-clear --verbose "$@" tests diff --git a/ci/test_cpp.sh b/ci/test_cpp.sh index 8a4e540e9b..8cc69b7643 100755 --- a/ci/test_cpp.sh +++ b/ci/test_cpp.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, NVIDIA CORPORATION. set -euo pipefail @@ -32,12 +32,9 @@ rapids-mamba-retry install \ rapids-logger "Check GPU usage" nvidia-smi -EXITCODE=0 -trap "EXITCODE=1" ERR -set +e - -# Run BASIC_IO_TEST -"$CONDA_PREFIX"/bin/tests/libkvikio/BASIC_IO_TEST +# Support invoking test_cpp.sh outside the script directory +"$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/run_ctests.sh \ + && EXITCODE=$? || EXITCODE=$?; rapids-logger "Test script exiting with value: $EXITCODE" exit ${EXITCODE} diff --git a/ci/test_python.sh b/ci/test_python.sh index 91fa442599..0869e1a3a0 100755 --- a/ci/test_python.sh +++ b/ci/test_python.sh @@ -1,8 +1,11 @@ #!/bin/bash -# Copyright (c) 2022-2023, NVIDIA CORPORATION. +# Copyright (c) 2022-2024, NVIDIA CORPORATION. set -euo pipefail +# Support invoking test_python.sh outside the script directory +cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../ + . /opt/conda/etc/profile.d/conda.sh rapids-logger "Generate Python testing dependencies" @@ -36,21 +39,14 @@ rapids-mamba-retry install \ rapids-logger "Check GPU usage" nvidia-smi -EXITCODE=0 -trap "EXITCODE=1" ERR -set +e - rapids-logger "pytest kvikio" -pushd python/ -pytest \ - --cache-clear \ +./ci/run_pytests.sh \ --junitxml="${RAPIDS_TESTS_DIR}/junit-kvikio.xml" \ - --verbose \ --cov-config=.coveragerc \ --cov=kvikio \ --cov-report=xml:"${RAPIDS_COVERAGE_DIR}/kvikio-coverage.xml" \ --cov-report=term \ - tests + && EXITCODE=$? || EXITCODE=$?; rapids-logger "Test script exiting with value: $EXITCODE" exit ${EXITCODE}