run-integration-tests: add support for blacklisting

This was done downstream in debian and ubuntu [1]. I want to change the
downstream file to use run-integration-tests so we can change the way tests
work more easily. Let's start moving downstream functionality upstream.

$ sudo BLACKLIST_MARKERS='blacklist-ubuntu-ci-arm64 blacklist-ubuntu-ci' \
   BUILD_DIR=build test/run-integration-tests.sh

[1] https://salsa.debian.org/systemd-team/systemd/-/blob/debian/master/debian/tests/upstream
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2020-03-25 13:46:44 +01:00
parent a455e75a30
commit 3597bf7550
1 changed files with 13 additions and 1 deletions

View File

@ -25,9 +25,21 @@ if [ $do_clean = 1 ]; then
done
fi
pass_blacklist() {
for marker in $BLACKLIST_MARKERS; do
if [ -f "$1/$marker" ]; then
echo "========== BLACKLISTED: $1 ($marker) =========="
return 1
fi
done
return 0
}
for TEST in TEST-??-* ; do
COUNT=$(($COUNT+1))
pass_blacklist $TEST || continue
echo -e "\n--x-- Running $TEST --x--"
set +e
( set -x ; make -C "$TEST" "BUILD_DIR=$BUILD_DIR" $args )
@ -41,7 +53,7 @@ for TEST in TEST-??-* ; do
done
if [ $FAILURES -eq 0 -a $do_clean = 1 ]; then
for TEST in TEST-??-* ; do
for TEST in ${!results[@]}; do
( set -x ; make -C "$TEST" "BUILD_DIR=$BUILD_DIR" clean-again )
done
fi