diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-06 00:55:53 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-06 00:55:53 +0000 |
commit | 3d0386f27ca66379acf50199e1d1298386eeeeb8 (patch) | |
tree | f87bd4a126b3a843858eb447e8fd5893c3ee3882 /tests/deckard/ci/runlocally.sh | |
parent | Initial commit. (diff) | |
download | knot-resolver-3d0386f27ca66379acf50199e1d1298386eeeeb8.tar.xz knot-resolver-3d0386f27ca66379acf50199e1d1298386eeeeb8.zip |
Adding upstream version 3.2.1.upstream/3.2.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-x | tests/deckard/ci/runlocally.sh | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/deckard/ci/runlocally.sh b/tests/deckard/ci/runlocally.sh new file mode 100755 index 0000000..25bf0c9 --- /dev/null +++ b/tests/deckard/ci/runlocally.sh @@ -0,0 +1,41 @@ +#!/bin/bash +set -o nounset -o errexit +CIDIR="$(dirname "$0")" +ORIGNAME="$(git symbolic-ref -q --short HEAD || git describe --all --always HEAD)" +FAILURE_DETECTED="?" + +function checkout_back { + git checkout --force "${ORIGNAME}" || { echo "Warning: unable to checkout back!"; exit 5; } + + test "${FAILURE_DETECTED}" "==" "0" && echo "All tests passed, good work!" + test "${FAILURE_DETECTED}" "!=" "0" && echo "Problem found, go fix it!" +} + +STATUS=$(git status --untracked-files=normal --porcelain) +test -n "${STATUS}" && echo "Working tree is dirty, commit your changes now." && exit 2 + +# return back to whatever branch we were on the beginning +# to avoid need for git checkout before fixing reported bugs +trap checkout_back EXIT +trap "{ FAILURE_DETECTED=1; }" ERR + +"${CIDIR}"/compare-rplint.sh +checkout_back +git clean -xdf + +"${CIDIR}"/compare-pylint.sh +checkout_back +git clean -xdf + +"${CIDIR}"/compare-pep8.sh +checkout_back +git clean -xdf + +"${CIDIR}"/compare-tests.sh "${CIDIR}/../kresd_run.sh" +checkout_back +git clean -xdf + +# at this point all the tests passed so we can clean up +git clean -xdf +FAILURE_DETECTED=0 +trap - ERR |