Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add environment-agnostic scripts for running ctests and pytests #1462

Merged
merged 19 commits into from
Feb 27, 2024
Merged
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
9 changes: 9 additions & 0 deletions ci/run_ctests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
# Copyright (c) 2024, NVIDIA CORPORATION.

set -euo pipefail

# Support customizing the ctests' install location
cd "${INSTALL_PREFIX:-${CONDA_PREFIX:-/usr}}/bin/gtests/librmm/"

ctest --no-tests=error --output-on-failure "$@"
9 changes: 9 additions & 0 deletions ci/run_pytests.sh
Original file line number Diff line number Diff line change
@@ -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 -v "$@" .
10 changes: 4 additions & 6 deletions ci/test_cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

set -euo pipefail

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

. /opt/conda/etc/profile.d/conda.sh

rapids-logger "Generate C++ testing dependencies"
Expand Down Expand Up @@ -31,16 +34,11 @@ rapids-mamba-retry install \
rapids-logger "Check GPU usage"
nvidia-smi

EXITCODE=0
trap "EXITCODE=1" ERR
set +e

# Run librmm gtests from librmm-tests package
rapids-logger "Run gtests"

cd $CONDA_PREFIX/bin/gtests/librmm/
export GTEST_OUTPUT=xml:${RAPIDS_TESTS_DIR}/
ctest -j20 --output-on-failure --no-tests=error
./ci/run_ctests.sh -j20 && EXITCODE=$? || EXITCODE=$?;

rapids-logger "Test script exiting with value: $EXITCODE"
exit ${EXITCODE}
28 changes: 13 additions & 15 deletions ci/test_python.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
#!/bin/bash
# Copyright (c) 2020-2023, NVIDIA CORPORATION.
# Copyright (c) 2020-2024, NVIDIA CORPORATION.

set -euo pipefail

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

rapids-logger "Create test conda environment"
. /opt/conda/etc/profile.d/conda.sh

Expand Down Expand Up @@ -33,21 +37,15 @@ mkdir -p "${RAPIDS_TESTS_DIR}" "${RAPIDS_COVERAGE_DIR}"
rapids-logger "Check GPU usage"
nvidia-smi

cd python

EXITCODE=0
trap "EXITCODE=1" ERR
set +e

rapids-logger "pytest rmm"
pytest \
--cache-clear \
--junitxml="${RAPIDS_TESTS_DIR}/junit-rmm.xml" \
-v \
--cov-config=.coveragerc \
--cov=rmm \
--cov-report=xml:"${RAPIDS_COVERAGE_DIR}/rmm-coverage.xml" \
--cov-report term

./ci/run_pytests.sh \
--junitxml="${RAPIDS_TESTS_DIR}/junit-rmm.xml" \
--cov-config=.coveragerc \
--cov=rmm \
--cov-report=xml:"${RAPIDS_COVERAGE_DIR}/rmm-coverage.xml" \
--cov-report term \
&& EXITCODE=$? || EXITCODE=$?;

rapids-logger "Test script exiting with value: $EXITCODE"
exit ${EXITCODE}
Loading