diff --git a/ci/run_ctests.sh b/ci/run_ctests.sh new file mode 100755 index 00000000000..318c3b183a8 --- /dev/null +++ b/ci/run_ctests.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# Copyright (c) 2024, NVIDIA CORPORATION. + +set -euo pipefail + +# Support customizing the ctests' install location +cd "${INSTALL_PREFIX:-${CONDA_PREFIX:-/usr}}/bin/gtests/libcugraph/" +ctest --output-on-failure --no-tests=error "$@" + +if [ -d "${INSTALL_PREFIX:-${CONDA_PREFIX:-/usr}}/bin/gtests/libcugraph_c/" ]; then + # Support customizing the ctests' install location + cd "${INSTALL_PREFIX:-${CONDA_PREFIX:-/usr}}/bin/gtests/libcugraph_c/" + ctest --output-on-failure --no-tests=error "$@" +fi diff --git a/ci/run_cugraph_benchmark_pytests.sh b/ci/run_cugraph_benchmark_pytests.sh new file mode 100755 index 00000000000..ae795ba3468 --- /dev/null +++ b/ci/run_cugraph_benchmark_pytests.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# Copyright (c) 2024, NVIDIA CORPORATION. + +set -euo pipefail + +# Support invoking run_cugraph_benchmark_pytests.sh outside the script directory +cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../benchmarks + +pytest --capture=no --benchmark-disable -m tiny "$@" cugraph/pytest-based/bench_algos.py diff --git a/ci/run_cugraph_dgl_pytests.sh b/ci/run_cugraph_dgl_pytests.sh new file mode 100755 index 00000000000..83c26a57dc0 --- /dev/null +++ b/ci/run_cugraph_dgl_pytests.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# Copyright (c) 2024, NVIDIA CORPORATION. + +set -euo pipefail + +# Support invoking run_cugraph_dgl_pytests.sh outside the script directory +cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/cugraph-dgl/tests + +pytest --cache-clear --ignore=mg "$@" . diff --git a/ci/run_cugraph_equivariant_pytests.sh b/ci/run_cugraph_equivariant_pytests.sh new file mode 100755 index 00000000000..5d5a5fb05c2 --- /dev/null +++ b/ci/run_cugraph_equivariant_pytests.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# Copyright (c) 2024, NVIDIA CORPORATION. + +set -euo pipefail + +# Support invoking run_cugraph_equivariant_pytests.sh outside the script directory +cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/cugraph-equivariant/cugraph_equivariant + +pytest --cache-clear "$@" . diff --git a/ci/run_cugraph_pyg_pytests.sh b/ci/run_cugraph_pyg_pytests.sh new file mode 100755 index 00000000000..47ed6ba0008 --- /dev/null +++ b/ci/run_cugraph_pyg_pytests.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# Copyright (c) 2024, NVIDIA CORPORATION. + +set -euo pipefail + +# Support invoking run_cugraph_pyg_pytests.sh outside the script directory +cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/cugraph-pyg/cugraph_pyg + +pytest --cache-clear --ignore=tests/mg "$@" . diff --git a/ci/run_cugraph_pytests.sh b/ci/run_cugraph_pytests.sh new file mode 100755 index 00000000000..c8776c9acd4 --- /dev/null +++ b/ci/run_cugraph_pytests.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# Copyright (c) 2024, NVIDIA CORPORATION. + +set -euo pipefail + +# Support invoking run_cugraph_pytests.sh outside the script directory +cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/cugraph/cugraph + +DASK_WORKER_DEVICES="${DASK_WORKER_DEVICES:-0}" \ +DASK_DISTRIBUTED__SCHEDULER__WORKER_TTL="${DASK_DISTRIBUTED__SCHEDULER__WORKER_TTL:-1000s}" \ +DASK_DISTRIBUTED__COMM__TIMEOUTS__CONNECT="${DASK_DISTRIBUTED__COMM__TIMEOUTS__CONNECT:-1000s}" \ +DASK_CUDA_WAIT_WORKERS_MIN_TIMEOUT="${DASK_CUDA_WAIT_WORKERS_MIN_TIMEOUT:-1000s}" \ +pytest --cache-clear --import-mode=append --benchmark-disable \ + -k "not test_property_graph_mg and not test_bulk_sampler_io" \ + "$@" \ + tests diff --git a/ci/run_cugraph_service_pytests.sh b/ci/run_cugraph_service_pytests.sh new file mode 100755 index 00000000000..772168dcc63 --- /dev/null +++ b/ci/run_cugraph_service_pytests.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# Copyright (c) 2024, NVIDIA CORPORATION. + +set -euo pipefail + +# Support invoking run_cugraph_service_pytests.sh outside the script directory +cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/cugraph-service + +pytest --capture=no --cache-clear --benchmark-disable -k "not mg" "$@" tests diff --git a/ci/run_nx_cugraph_pytests.sh b/ci/run_nx_cugraph_pytests.sh new file mode 100755 index 00000000000..b0caffd0a0f --- /dev/null +++ b/ci/run_nx_cugraph_pytests.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# Copyright (c) 2024, NVIDIA CORPORATION. + +set -euo pipefail + +# Support invoking run_nx_cugraph_pytests.sh outside the script directory +cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/nx-cugraph/nx_cugraph + +pytest --capture=no --cache-clear --benchmark-disable "$@" tests diff --git a/ci/run_pylibcugraph_pytests.sh b/ci/run_pylibcugraph_pytests.sh new file mode 100755 index 00000000000..ee403bd4a66 --- /dev/null +++ b/ci/run_pylibcugraph_pytests.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# Copyright (c) 2024, NVIDIA CORPORATION. + +set -euo pipefail + +# Support invoking run_pylibcugraph_pytests.sh outside the script directory +cd "$(dirname "$(realpath "${BASH_SOURCE[0]}")")"/../python/pylibcugraph/pylibcugraph + +pytest --cache-clear "$@" tests diff --git a/ci/test_cpp.sh b/ci/test_cpp.sh index 39fff52bd94..2cd7d02670f 100755 --- a/ci/test_cpp.sh +++ b/ci/test_cpp.sh @@ -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" @@ -38,21 +41,11 @@ pushd "${RAPIDS_DATASET_ROOT_DIR}" ./get_test_data.sh --subset popd -EXITCODE=0 -trap "EXITCODE=1" ERR -set +e - export GTEST_OUTPUT=xml:${RAPIDS_TESTS_DIR}/ # Run libcugraph gtests from libcugraph-tests package rapids-logger "Run gtests" -cd "$CONDA_PREFIX"/bin/gtests/libcugraph/ -ctest -j10 --output-on-failure --no-tests=error - -if [ -d "$CONDA_PREFIX"/bin/gtests/libcugraph_c/ ]; then - cd "$CONDA_PREFIX"/bin/gtests/libcugraph_c/ - ctest -j10 --output-on-failure --no-tests=error -fi +./ci/run_ctests.sh -j10 && 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 b070143f076..8fa9a90ae69 100755 --- a/ci/test_python.sh +++ b/ci/test_python.sh @@ -3,6 +3,9 @@ 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" @@ -52,16 +55,14 @@ trap "EXITCODE=1" ERR set +e rapids-logger "pytest pylibcugraph" -pushd python/pylibcugraph/pylibcugraph -pytest \ - --cache-clear \ +./ci/run_pylibcugraph_pytests.sh \ + --verbose \ --junitxml="${RAPIDS_TESTS_DIR}/junit-pylibcugraph.xml" \ --cov-config=../../.coveragerc \ --cov=pylibcugraph \ --cov-report=xml:"${RAPIDS_COVERAGE_DIR}/pylibcugraph-coverage.xml" \ - --cov-report=term \ - tests -popd + --cov-report=term + # Test runs that include tests that use dask require # --import-mode=append. Those tests start a LocalCUDACluster that inherits @@ -74,49 +75,26 @@ popd # FIXME: TEMPORARILY disable MG PropertyGraph tests (experimental) tests and # bulk sampler IO tests (hangs in CI) rapids-logger "pytest cugraph" -pushd python/cugraph/cugraph -DASK_WORKER_DEVICES="0" \ -DASK_DISTRIBUTED__SCHEDULER__WORKER_TTL="1000s" \ -DASK_DISTRIBUTED__COMM__TIMEOUTS__CONNECT="1000s" \ -DASK_CUDA_WAIT_WORKERS_MIN_TIMEOUT="1000s" \ -pytest \ - -v \ - --import-mode=append \ - --benchmark-disable \ - --cache-clear \ +./ci/run_cugraph_pytests.sh \ + --verbose \ --junitxml="${RAPIDS_TESTS_DIR}/junit-cugraph.xml" \ --cov-config=../../.coveragerc \ --cov=cugraph \ --cov-report=xml:"${RAPIDS_COVERAGE_DIR}/cugraph-coverage.xml" \ - --cov-report=term \ - -k "not test_property_graph_mg and not test_bulk_sampler_io" \ - tests -popd + --cov-report=term + rapids-logger "pytest cugraph benchmarks (run as tests)" -pushd benchmarks -pytest \ - --capture=no \ - --verbose \ - -m tiny \ - --benchmark-disable \ - cugraph/pytest-based/bench_algos.py -popd +./ci/run_cugraph_benchmark_pytests.sh --verbose rapids-logger "pytest nx-cugraph" -pushd python/nx-cugraph/nx_cugraph -pytest \ - --capture=no \ +./ci/run_nx_cugraph_pytests.sh \ --verbose \ - --cache-clear \ --junitxml="${RAPIDS_TESTS_DIR}/junit-nx-cugraph.xml" \ --cov-config=../../.coveragerc \ --cov=nx_cugraph \ --cov-report=xml:"${RAPIDS_COVERAGE_DIR}/nx-cugraph-coverage.xml" \ - --cov-report=term \ - --benchmark-disable \ - tests -popd + --cov-report=term rapids-logger "pytest networkx using nx-cugraph backend" pushd python/nx-cugraph @@ -150,21 +128,14 @@ python -m nx_cugraph.scripts.print_table popd rapids-logger "pytest cugraph-service (single GPU)" -pushd python/cugraph-service -pytest \ - --capture=no \ +./ci/run_cugraph_service_pytests.sh \ --verbose \ - --cache-clear \ --junitxml="${RAPIDS_TESTS_DIR}/junit-cugraph-service.xml" \ --cov-config=../.coveragerc \ --cov=cugraph_service_client \ --cov=cugraph_service_server \ --cov-report=xml:"${RAPIDS_COVERAGE_DIR}/cugraph-service-coverage.xml" \ - --cov-report=term \ - --benchmark-disable \ - -k "not mg" \ - tests -popd + --cov-report=term if [[ "${RAPIDS_CUDA_VERSION}" == "11.8.0" ]]; then if [[ "${RUNNER_ARCH}" != "ARM64" ]]; then @@ -195,17 +166,12 @@ if [[ "${RAPIDS_CUDA_VERSION}" == "11.8.0" ]]; then rapids-print-env rapids-logger "pytest cugraph_dgl (single GPU)" - pushd python/cugraph-dgl/tests - pytest \ - --cache-clear \ - --ignore=mg \ + ./ci/run_cugraph_dgl_pytests.sh \ --junitxml="${RAPIDS_TESTS_DIR}/junit-cugraph-dgl.xml" \ --cov-config=../../.coveragerc \ --cov=cugraph_dgl \ --cov-report=xml:"${RAPIDS_COVERAGE_DIR}/cugraph-dgl-coverage.xml" \ - --cov-report=term \ - . - popd + --cov-report=term # Reactivate the test environment back set +u @@ -252,18 +218,13 @@ if [[ "${RAPIDS_CUDA_VERSION}" == "11.8.0" ]]; then rapids-print-env rapids-logger "pytest cugraph_pyg (single GPU)" - pushd python/cugraph-pyg/cugraph_pyg # rmat is not tested because of multi-GPU testing - pytest \ - --cache-clear \ - --ignore=tests/mg \ + ./ci/run_cugraph_pyg_pytests.sh \ --junitxml="${RAPIDS_TESTS_DIR}/junit-cugraph-pyg.xml" \ --cov-config=../../.coveragerc \ --cov=cugraph_pyg \ --cov-report=xml:"${RAPIDS_COVERAGE_DIR}/cugraph-pyg-coverage.xml" \ - --cov-report=term \ - . - popd + --cov-report=term # Reactivate the test environment back set +u @@ -296,16 +257,12 @@ if [[ "${RAPIDS_CUDA_VERSION}" == "11.8.0" ]]; then rapids-print-env rapids-logger "pytest cugraph-equivariant" - pushd python/cugraph-equivariant/cugraph_equivariant - pytest \ - --cache-clear \ + ./ci/run_cugraph_equivariant_pytests.sh \ --junitxml="${RAPIDS_TESTS_DIR}/junit-cugraph-equivariant.xml" \ --cov-config=../../.coveragerc \ --cov=cugraph_equivariant \ --cov-report=xml:"${RAPIDS_COVERAGE_DIR}/cugraph-equivariant-coverage.xml" \ - --cov-report=term \ - . - popd + --cov-report=term # Reactivate the test environment back set +u