docker-postfix/integration-tests.sh
Bojan Čekrlić 7d2188114b Disable xoauth2 integration testst
While these tests are neccessary, they cannot be completed
immutably. They rely in access and refresh token from Google
and these expire -- we would need to devise a smart way of
getting them every time before the tests are run.
2020-11-07 08:57:58 +01:00

40 lines
968 B
Bash
Executable file

#!/usr/bin/env bash
set -e
cd integration-tests
run_test() {
local exit_code
echo
echo
echo "☆☆☆☆☆☆☆☆☆☆ $1 ☆☆☆☆☆☆☆☆☆☆"
echo
(
cd "$1"
set +e
docker-compose up --build --abort-on-container-exit --exit-code-from tests
exit_code="$?"
docker-compose down -v
if [[ "$exit_code" != 0 ]]; then
exit "$exit_code"
fi
set -e
)
}
if [[ $# -gt 0 ]]; then
while [[ -n "$1" ]]; do
run_test "$1"
shift
done
else
# Disable xoauth2 integration tests as they an access and refresh token. And these expire
# after a certain time, so we cannot rely on tests working all the time.
for i in `find -maxdepth 1 -type d | grep -Ev "^./(xoauth2|tester)" | sort`; do
i="$(basename "$i")"
if [ "$i" == "." ] || [ "$i" == ".." ]; then
continue
fi
run_test $i
done
fi