diff --git a/tools/docker/scripts/install_aiida.sh b/tools/docker/scripts/install_aiida.sh index 73107e6db0..bad4a6db78 100755 --- a/tools/docker/scripts/install_aiida.sh +++ b/tools/docker/scripts/install_aiida.sh @@ -20,7 +20,7 @@ rm -rf /var/lib/apt/lists/* # install dependencies of aiida-cp2k cd /opt/ git clone --quiet https://github.com/aiidateam/aiida-cp2k.git -pip3 install --quiet ./aiida-cp2k/[test] +pip3 install --quiet './aiida-cp2k/[test]' pip3 uninstall --quiet --yes aiida-cp2k # create ubuntu user with sudo powers @@ -31,7 +31,8 @@ echo "ubuntu ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers source /opt/cp2k-toolchain/install/setup # link mpi executables into path -for i in $(dirname "$(which mpirun)")/* ; do ln -sf "$i" /usr/bin/; done +MPI_INSTALL_DIR=$(dirname "$(command -v mpirun)") +for i in "${MPI_INSTALL_DIR}"/* ; do ln -sf "$i" /usr/bin/; done # setup arch files cd /workspace/cp2k/arch diff --git a/tools/docker/scripts/install_regtest.sh b/tools/docker/scripts/install_regtest.sh index 6086af5163..bc770801ae 100755 --- a/tools/docker/scripts/install_regtest.sh +++ b/tools/docker/scripts/install_regtest.sh @@ -11,20 +11,20 @@ ARCH=$1 VERSION=$2 # setup arch files -cd /workspace/cp2k/arch +cd /workspace/cp2k/arch || exit 1 ln -vs /opt/cp2k-toolchain/install/arch/local* . # shellcheck disable=SC1091 source /opt/cp2k-toolchain/install/setup # Make OpenMPI happy. -if which ompi_info &> /dev/null ; then +if command -v ompi_info &> /dev/null ; then TESTOPTS="-mpiexec 'mpiexec --bind-to none --allow-run-as-root' ${TESTOPTS}" export OMPI_MCA_plm_rsh_agent=/bin/false fi # pre-build cp2k -cd /workspace/cp2k +cd /workspace/cp2k || exit 1 echo -n "Warming cache by trying to compile... " if make -j ARCH="${ARCH}" VERSION="${VERSION}" &> /dev/null ; then echo "done." diff --git a/tools/docker/scripts/test_aiida.sh b/tools/docker/scripts/test_aiida.sh index 289ece78a2..77c743f1bc 100755 --- a/tools/docker/scripts/test_aiida.sh +++ b/tools/docker/scripts/test_aiida.sh @@ -8,19 +8,20 @@ source /opt/cp2k-toolchain/install/setup echo -e "\n========== Compiling CP2K ==========" cd /workspace/cp2k echo -n "Compiling cp2k... " -if make -j VERSION=pdbg &> /dev/null ; then - echo "done." +if make -j VERSION=pdbg &> make.out ; then + echo "done." else - echo -e "failed.\n\n" - echo "Summary: Compilation failed." - echo "Status: FAILED" - exit + echo -e "failed.\n\n" + tail -n 100 make.out + echo -e "\nSummary: Compilation failed." + echo -e "Status: FAILED\n" + exit 0 fi echo -e "\n========== Installing AiiDA-CP2K plugin ==========" cd /opt/aiida-cp2k/ git pull -pip3 install ./[test] +pip3 install './[test]' echo -e "\n========== Configuring AiiDA ==========" AS_UBUNTU_USER="sudo -u ubuntu -H" diff --git a/tools/docker/scripts/test_ase.sh b/tools/docker/scripts/test_ase.sh index b68706c485..7d08ac7e12 100755 --- a/tools/docker/scripts/test_ase.sh +++ b/tools/docker/scripts/test_ase.sh @@ -7,13 +7,14 @@ source /opt/cp2k-toolchain/install/setup cd /workspace/cp2k echo -n "Compiling cp2k... " -if make -j VERSION=pdbg &> /dev/null ; then - echo "done." +if make -j VERSION=pdbg &> make.out ; then + echo "done." else - echo -e "failed.\n\n" - echo "Summary: Compilation failed." - echo "Status: FAILED" - exit + echo -e "failed.\n\n" + tail -n 100 make.out + echo -e "\nSummary: Compilation failed." + echo -e "Status: FAILED\n" + exit 0 fi echo -e "\n========== Installing CP2K ==========" diff --git a/tools/docker/scripts/test_coverage.sh b/tools/docker/scripts/test_coverage.sh index fc5f8abe39..43917ad3b5 100755 --- a/tools/docker/scripts/test_coverage.sh +++ b/tools/docker/scripts/test_coverage.sh @@ -14,7 +14,7 @@ VERSION=$1 source /opt/cp2k-toolchain/install/setup echo -e "\n========== Running Regtests ==========" -cd /workspace/cp2k +cd /workspace/cp2k || exit 1 CP2K_REVISION=$(./tools/build_utils/get_revision_number ./src) rm -rf "obj/${ARCH}/${VERSION}"/*.gcda # remove old gcov statistics @@ -24,9 +24,9 @@ make ARCH="${ARCH}" VERSION="${VERSION}" TESTOPTS="${TESTOPTS}" test # Maybe related: https://bugs.launchpad.net/gcc-arm-embedded/+bug/1694644 # As a workaround we'll simply remove the offending files for now. rm -f "/workspace/cp2k/obj/${ARCH}/${VERSION}"/exts/*/*.gcda -cd /tmp +cd /tmp || exit 1 GCOV_TIMEOUT="10s" -for fn in /workspace/cp2k/obj/${ARCH}/${VERSION}/*.gcda; do +for fn in "/workspace/cp2k/obj/${ARCH}/${VERSION}"/*.gcda ; do if ! timeout "${GCOV_TIMEOUT}" gcov "$fn" &> /dev/null ; then echo "Skipping ${fn} because gcov took longer than ${GCOV_TIMEOUT}." rm "${fn}" @@ -35,7 +35,7 @@ done # collect coverage stats mkdir -p /workspace/artifacts/coverage -cd /workspace/artifacts/coverage +cd /workspace/artifacts/coverage || exit 1 lcov --directory "/workspace/cp2k/obj/${ARCH}/${VERSION}" --capture --output-file coverage.info > lcov.log lcov --summary coverage.info diff --git a/tools/docker/scripts/test_i-pi.sh b/tools/docker/scripts/test_i-pi.sh index 5bb9d133a8..5e2dab96a4 100755 --- a/tools/docker/scripts/test_i-pi.sh +++ b/tools/docker/scripts/test_i-pi.sh @@ -8,13 +8,14 @@ source /opt/cp2k-toolchain/install/setup echo -e "\n========== Compiling CP2K ==========" cd /workspace/cp2k echo -n "Compiling cp2k... " -if make -j VERSION=pdbg &> /dev/null ; then - echo "done." +if make -j VERSION=pdbg &> make.out ; then + echo "done." else - echo -e "failed.\n\n" - echo "Summary: Compilation failed." - echo "Status: FAILED" - exit + echo -e "failed.\n\n" + tail -n 100 make.out + echo -e "\nSummary: Compilation failed." + echo -e "Status: FAILED\n" + exit 0 fi echo -e "\n========== Installing i-Pi ==========" diff --git a/tools/docker/scripts/test_manual.sh b/tools/docker/scripts/test_manual.sh index 28a1d25fbb..8000e918bd 100755 --- a/tools/docker/scripts/test_manual.sh +++ b/tools/docker/scripts/test_manual.sh @@ -8,7 +8,16 @@ source /opt/cp2k-toolchain/install/setup echo -e "\n========== Compiling CP2K ==========" cd /workspace/cp2k touch src/cp2k_info.F # ensure latest REVISION is picked up. -make -j VERSION="psmp" cp2k +echo -n "Compiling cp2k... " +if make -j VERSION=psmp &> make.out ; then + echo "done." +else + echo -e "failed.\n\n" + tail -n 100 make.out + echo -e "\nSummary: Compilation failed." + echo -e "Status: FAILED\n" + exit 0 +fi echo -e "\n========== Generating Manual ==========" diff --git a/tools/docker/scripts/test_python.sh b/tools/docker/scripts/test_python.sh index eb262655bc..f90a2d7687 100755 --- a/tools/docker/scripts/test_python.sh +++ b/tools/docker/scripts/test_python.sh @@ -40,7 +40,6 @@ cd /workspace/cp2k # find executable python scripts ALL_TEST_SCRIPTS=$(find ./src/ ./tools/ -name "*_test.py" -executable) -ESSENTIAL_TEST_SCRIPTS=$(find ./tools/build_utils -name "*_test.py" -executable) # python 3.x run_tests python3 "${ALL_TEST_SCRIPTS}" diff --git a/tools/docker/scripts/test_regtest.sh b/tools/docker/scripts/test_regtest.sh index a472c7892b..91ed928d68 100755 --- a/tools/docker/scripts/test_regtest.sh +++ b/tools/docker/scripts/test_regtest.sh @@ -14,18 +14,18 @@ VERSION=$2 source /opt/cp2k-toolchain/install/setup # Make OpenMPI happy. -if which ompi_info &> /dev/null ; then +if command -v ompi_info &> /dev/null ; then TESTOPTS="-mpiexec 'mpiexec --bind-to none --allow-run-as-root' ${TESTOPTS}" export OMPI_MCA_plm_rsh_agent=/bin/false fi echo -en "\nCompiling cp2k... " -cd /workspace/cp2k +cd /workspace/cp2k || exit 1 if make -j ARCH="${ARCH}" VERSION="${VERSION}" &> make.out ; then echo "done." else - echo "failed." - cat make.out + echo -e "failed.\n\n" + tail -n 100 make.out echo -e "\nSummary: Compilation failed." echo -e "Status: FAILED\n" exit 0 diff --git a/tools/docker/scripts/test_scaling.sh b/tools/docker/scripts/test_scaling.sh index 8e36fd51ce..b8a3d7b40b 100755 --- a/tools/docker/scripts/test_scaling.sh +++ b/tools/docker/scripts/test_scaling.sh @@ -8,15 +8,16 @@ source /opt/cp2k-toolchain/install/setup echo -e '\n========== Compiling CP2K ==========' cd /workspace/cp2k for VERSION in 'psmp' 'ssmp' ; do - echo -n "Compiling cp2k.${VERSION}... " - if make -j VERSION="${VERSION}" &> /dev/null ; then - echo 'done.' - else - echo -e 'failed.\n\n' - echo 'Summary: Compilation failed.' - echo 'Status: FAILED' - exit - fi + echo -n "Compiling cp2k.${VERSION}... " + if make -j VERSION="${VERSION}" &> make.out ; then + echo "done." + else + echo -e "failed.\n\n" + tail -n 100 make.out + echo -e "\nSummary: Compilation failed." + echo -e "Status: FAILED\n" + exit 0 + fi done echo -e '\n========== Running Scaling Test =========='