Skip to content

Commit

Permalink
Merge pull request QMCPACK#3081 from williamfgc/ci-asan-filter
Browse files Browse the repository at this point in the history
Enable address sanitizer (asan) on GitHub Actions CI
  • Loading branch information
ye-luo authored Apr 8, 2021
2 parents b1a4692 + bd4cfae commit 81b05a9
Show file tree
Hide file tree
Showing 8 changed files with 33 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/ci-github-actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ jobs:
jobname: [
gcc-openmpi-real-coverage,
gcc-openmpi-complex-coverage,
clang-openmpi-real-asan,
clang-openmpi-real-ubsan
]
include:
Expand All @@ -36,6 +37,11 @@ jobs:
image: williamfgc/qmcpack-ci:ubuntu20-openmpi
options: -u 1001

- jobname: clang-openmpi-real-asan
container:
image: williamfgc/qmcpack-ci:ubuntu20-openmpi
options: -u 1001

- jobname: clang-openmpi-real-ubsan
container:
image: williamfgc/qmcpack-ci:ubuntu20-openmpi
Expand Down
3 changes: 3 additions & 0 deletions src/Estimators/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ TARGET_LINK_LIBRARIES(${UTEST_EXE} qmcutil qmcestimators_unit qmcham_unit qmcwfs
ENDIF()

ADD_UNIT_TEST(${UTEST_NAME} 1 1 "${QMCPACK_UNIT_TEST_DIR}/${UTEST_EXE}")
IF( "${ENABLE_SANITIZER}" STREQUAL "asan" )
SET_TESTS_PROPERTIES(${UTEST_NAME} PROPERTIES LABELS noasan)
ENDIF()

IF(HAVE_MPI)
SET(UTEST_EXE test_${SRC_DIR}_mpi)
Expand Down
5 changes: 5 additions & 0 deletions src/QMCApp/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,8 @@ IF(USE_OBJECT_TARGET)
ENDIF()

ADD_UNIT_TEST(${UTEST_NAME} 1 1 "${QMCPACK_UNIT_TEST_DIR}/${UTEST_EXE}")

# temporary label until asan leaks are resolved
IF( "${ENABLE_SANITIZER}" STREQUAL "asan" )
SET_TESTS_PROPERTIES(${UTEST_NAME} PROPERTIES LABELS noasan)
ENDIF()
6 changes: 6 additions & 0 deletions src/QMCDrivers/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ ENDIF()

ADD_UNIT_TEST(${UTEST_NAME} 1 1 "${QMCPACK_UNIT_TEST_DIR}/${UTEST_EXE}")
SET_TESTS_PROPERTIES(${UTEST_NAME} PROPERTIES WORKING_DIRECTORY ${UTEST_DIR})
IF( "${ENABLE_SANITIZER}" STREQUAL "asan" )
SET_TESTS_PROPERTIES(${UTEST_NAME} PROPERTIES LABELS noasan)
ENDIF()


IF(NOT QMC_CUDA)
Expand All @@ -73,6 +76,9 @@ IF(NOT QMC_CUDA)

ADD_UNIT_TEST(${UTEST_NAME} 1 1 "${QMCPACK_UNIT_TEST_DIR}/${UTEST_EXE}")
SET_TESTS_PROPERTIES(${UTEST_NAME} PROPERTIES WORKING_DIRECTORY ${UTEST_DIR})
IF( "${ENABLE_SANITIZER}" STREQUAL "asan" )
SET_TESTS_PROPERTIES(${UTEST_NAME} PROPERTIES LABELS noasan)
ENDIF()


IF(HAVE_MPI)
Expand Down
3 changes: 3 additions & 0 deletions src/QMCHamiltonians/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,6 @@ ENDIF()
ADD_UNIT_TEST(${UTEST_NAME} 1 1 "${QMCPACK_UNIT_TEST_DIR}/${UTEST_EXE}")
SET_TESTS_PROPERTIES(${UTEST_NAME} PROPERTIES WORKING_DIRECTORY ${UTEST_DIR})

IF( "${ENABLE_SANITIZER}" STREQUAL "asan" )
SET_TESTS_PROPERTIES(${UTEST_NAME} PROPERTIES LABELS noasan)
ENDIF()
3 changes: 3 additions & 0 deletions src/QMCWaveFunctions/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,7 @@ FOREACH(CATEGORY trialwf sposet jastrow determinant)

ADD_UNIT_TEST(${UTEST_NAME} 1 1 "${QMCPACK_UNIT_TEST_DIR}/${UTEST_EXE}")
SET_TESTS_PROPERTIES(${UTEST_NAME} PROPERTIES WORKING_DIRECTORY ${UTEST_DIR})
IF( "${ENABLE_SANITIZER}" STREQUAL "asan" )
SET_TESTS_PROPERTIES(${UTEST_NAME} PROPERTIES LABELS noasan)
ENDIF()
ENDFOREACH()
5 changes: 5 additions & 0 deletions src/einspline/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,8 @@ ADD_EXECUTABLE(${UTEST_EXE} ${SRCS})
TARGET_LINK_LIBRARIES(${UTEST_EXE} catch_main ${CUDATESTLIB} einspline qmcutil)

ADD_UNIT_TEST( ${UTEST_NAME} 1 1 "${QMCPACK_UNIT_TEST_DIR}/${UTEST_EXE}")

# temporary label until asan leaks are resolved
IF( "${ENABLE_SANITIZER}" STREQUAL "asan" )
SET_TESTS_PROPERTIES(${UTEST_NAME} PROPERTIES LABELS noasan)
ENDIF()
4 changes: 2 additions & 2 deletions tests/test_automation/github-actions/ci/run_step.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ case "$1" in
# Enable ASAN_OPTION=suppression=suppresion_file
if [[ "${GH_JOBNAME}" =~ (asan) ]]
then
echo "Enabling LSAN suppression file config/sanitizers/lsan.supp"
export LSAN_OPTIONS=suppression=${GITHUB_WORKSPACE}/config/sanitizers/lsan.supp
echo "Enabling LSAN suppressions file config/sanitizers/lsan.supp"
export LSAN_OPTIONS=suppressions=${GITHUB_WORKSPACE}/config/sanitizers/lsan.supp
fi

# Run only deterministic tests (reasonable for CI)
Expand Down

0 comments on commit 81b05a9

Please sign in to comment.