Skip to content

Commit

Permalink
Fix ctest directory to ensure tests are executed (#5753)
Browse files Browse the repository at this point in the history
C++ tests were not being run because the `test_cpp.sh` script was not executing `ctest` from the tests directory. This PR fixes that problem and adds the flag `--no-tests=error` to fail if no tests are found in the future.

It seems this was broken in #5487.

Also closes #5757 (includes the same changes).

Authors:
   - Dante Gama Dessavre (https://github.com/dantegd)
   - Bradley Dice (https://github.com/bdice)
   - Ray Douglass (https://github.com/raydouglass)

Approvers:
   - Ray Douglass (https://github.com/raydouglass)
  • Loading branch information
bdice authored Feb 9, 2024
1 parent 2d8f1c2 commit d3349c7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
10 changes: 7 additions & 3 deletions ci/test_cpp.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
# Copyright (c) 2022-2023, NVIDIA CORPORATION.
# Copyright (c) 2022-2024, NVIDIA CORPORATION.

set -euo pipefail

Expand Down Expand Up @@ -37,8 +37,12 @@ trap "EXITCODE=1" ERR
set +e

# Run libcuml gtests from libcuml-tests package
rapids-logger "Run gtests"
ctest -j9 --output-on-failure
export GTEST_OUTPUT=xml:${RAPIDS_TESTS_DIR}/

pushd $CONDA_PREFIX/bin/gtests/libcuml/
rapids-logger "Run libcuml gtests"
ctest -j9 --output-on-failure --no-tests=error
popd

rapids-logger "Test script exiting with value: $EXITCODE"
exit ${EXITCODE}
4 changes: 2 additions & 2 deletions cpp/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#=============================================================================
# Copyright (c) 2018-2023, NVIDIA CORPORATION.
# Copyright (c) 2018-2024, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -182,7 +182,7 @@ if(all_algo OR solvers_algo)
endif()

if(all_algo OR svm_algo)
ConfigureTest(PREFIX SG NAME SVC_TEST sg/svc_test.cu ML_INCLUDE)
ConfigureTest(PREFIX SG NAME SVC_TEST sg/svc_test.cu ML_INCLUDE GPUS 1 PERCENT 100)
# The SVC Test tries to verify it has no memory leaks by checking
# how much free memory on the GPU exists after execution. This
# check requires no other GPU tests to be running or it fails
Expand Down
2 changes: 2 additions & 0 deletions cpp/test/sg/svc_test.cu
Original file line number Diff line number Diff line change
Expand Up @@ -1397,6 +1397,8 @@ TYPED_TEST(SmoSolverTest, BlobPredict)

TYPED_TEST(SmoSolverTest, MemoryLeak)
{
GTEST_SKIP(); // Skip the tests in CI for release 24.02
// https://github.com/rapidsai/cuml/issues/5763
auto stream = this->handle.get_stream();
// We measure that we have the same amount of free memory available on the GPU
// before and after we call SVM. This can help catch memory leaks, but it is
Expand Down

0 comments on commit d3349c7

Please sign in to comment.