From c0217aef7e15ac8621ccf60792a04747f41d6586 Mon Sep 17 00:00:00 2001 From: Sergey Kosukhin <sergey.kosukhin@mpimet.mpg.de> Date: Wed, 13 Jul 2022 18:17:14 +0200 Subject: [PATCH] Add a script to run all CI tests for the current test environment. --- .ci/bb/run_all.sh | 60 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100755 .ci/bb/run_all.sh diff --git a/.ci/bb/run_all.sh b/.ci/bb/run_all.sh new file mode 100755 index 000000000..583e36a23 --- /dev/null +++ b/.ci/bb/run_all.sh @@ -0,0 +1,60 @@ +#!/bin/bash + +set -eu +set -o pipefail + +script_dir=$(cd "$(dirname "$0")"; pwd) +top_srcdir=$(cd "${script_dir}/../.."; pwd) + +test_environment='unknown' +case $(uname -s) in + Linux) + node_name=$(uname -n) + case $(host "${node_name}") in + mpipc*.mpimet.mpg.de\ * | \ + breeze*.mpimet.mpg.de\ *) + test_environment='breeze-mpim' ;; + levante*.atos.local\ *) + test_environment='levante-dkrz' ;; + daint*.login.cscs.ch\ *) + test_environment='daint-cscs' ;; + esac +esac + +test "x${test_environment}" != 'xunknown' || { + echo 'ERROR: unknown test environment' >&2 + exit 1 +} + +cd "${top_srcdir}" + +git update-index -q --refresh || { + echo "ERROR: failed to update git index in '${top_srcdir}'" >&2 + exit 1 +} + +git diff-files --quiet || { + echo "ERROR: '${top_srcdir}' has unstaged changes" >&2 + exit 1 +} + +untracked_files=`git ls-files --others` || { + echo "ERROR: failed to get list of untracked files in '${top_srcdir}'" >&2 + exit 1 +} +if test -n "${untracked_files}"; then + { + echo "ERROR: '${top_srcdir}' has untracked files:" >&2 + echo "${untracked_files}" >&2 + } >&2 + exit 1 +fi + +echo "Running tests for '${test_environment}'" + +for script in $(find "${script_dir}/${test_environment}" -type f -name 'test.*' -executable); do + echo "Running '${script}'" + "${script}" + git clean -fdx + git checkout . +done -- GitLab