Commit 1a815513 authored by Štěpán Balážik's avatar Štěpán Balážik Committed by Petr Špaček

ci: fix running of rplint on new and modified tests

parent a7528ca7
Pipeline #43181 passed with stage
in 3 minutes and 25 seconds
...@@ -6,17 +6,26 @@ source "$(dirname "$(readlink -f "$0")")/common.sh" ...@@ -6,17 +6,26 @@ source "$(dirname "$(readlink -f "$0")")/common.sh"
function find_new_tests { function find_new_tests {
: detect tests affected by current merge request : detect tests affected by current merge request
: store list of modified tests in ${NEW_TESTS_FILE} : store list of modified tests in ${NEW_TESTS_FILE}
git diff --name-only --diff-filter=A ${MERGEBASE} ${HEAD} | fgrep .rpl > "${NEW_TESTS_FILE}" || : no new tests detected git diff --name-only --diff-filter=AM ${MERGEBASE} ${HEAD} | fgrep .rpl > "${NEW_TESTS_FILE}" || : no new tests detected
} }
NEW_TESTS_FILE="/tmp/new_tests" NEW_TESTS_FILE="/tmp/new_tests"
find_new_tests find_new_tests
truncate -s0 /tmp/rplint_fails truncate -s0 /tmp/rplint_fails
: run rplint of all new tests
FAIL=0
cat /tmp/new_tests
for test in $(cat ${NEW_TESTS_FILE}) for test in $(cat ${NEW_TESTS_FILE})
do do
${PYTHON} -m rplint $test >> /tmp/rplint_fails ${PYTHON} -m rplint $test >> /tmp/rplint_fails || FAIL=1
done done
cat /tmp/rplint_fails : if even one of the test does not pass rplint, fail
test "!" -s /tmp/rplint_fails if [ "$FAIL" -eq 1 ]
then
cat /tmp/rplint_fails
exit 1
fi
exit 0
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment