diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 15:26:00 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 15:26:00 +0000 |
commit | 830407e88f9d40d954356c3754f2647f91d5c06a (patch) | |
tree | d6a0ece6feea91f3c656166dbaa884ef8a29740e /tests/integration/deckard/ci/compare-rplint.sh | |
parent | Initial commit. (diff) | |
download | knot-resolver-upstream.tar.xz knot-resolver-upstream.zip |
Adding upstream version 5.6.0.upstream/5.6.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/integration/deckard/ci/compare-rplint.sh')
-rwxr-xr-x | tests/integration/deckard/ci/compare-rplint.sh | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/integration/deckard/ci/compare-rplint.sh b/tests/integration/deckard/ci/compare-rplint.sh new file mode 100755 index 0000000..0146dc9 --- /dev/null +++ b/tests/integration/deckard/ci/compare-rplint.sh @@ -0,0 +1,31 @@ +#!/bin/bash +set -o nounset -o xtrace -o errexit +source "$(dirname "$(readlink -f "$0")")/common.sh" + + +function find_new_tests { + : detect tests affected by current merge request + : store list of modified tests in ${NEW_TESTS_FILE} + git diff --name-only --diff-filter=AM ${MERGEBASE} ${HEAD} | fgrep .rpl > "${NEW_TESTS_FILE}" || : no new tests detected +} + +NEW_TESTS_FILE="/tmp/new_tests" +find_new_tests + +truncate -s0 /tmp/rplint_fails + +: run rplint of all new tests +FAIL=0 +cat /tmp/new_tests +for test in $(cat ${NEW_TESTS_FILE}) +do + ${PYTHON} -m rplint $test >> /tmp/rplint_fails || FAIL=1 +done + +: if even one of the test does not pass rplint, fail +if [ "$FAIL" -eq 1 ] +then + cat /tmp/rplint_fails + exit 1 +fi +exit 0 |