openSUSE-release-tools/dist/ci/docker-compose-test.sh
Stephan Kulow c412dada22 CI: Split the tests in multiple runs
A test run of 40 minutes is just too much to wait for. So tag the long
running jobs to run in a special run
2022-03-07 18:48:43 +01:00

44 lines
965 B
Bash
Executable File

#!/bin/bash
set -e
until curl http://api:3000/about 2>/dev/null ; do
echo "waiting for OBS to be responsive..."
# Print osc output incase of failure and container logs for debugging.
((c++)) && ((c==60)) && (
curl http://api:3000/about
exit 1
)
sleep 1
done
cd /code
ci_node=$1
for file in tests/*_tests.py; do
if test -n "$ci_node"; then
if test "$ci_node" == "Rest"; then
if grep -q '# CI-Node' $file; then
echo "Skipping $file in 'Rest'"
continue
fi
else
if ! grep -q "# CI-Node: $ci_node" $file; then
continue
fi
fi
fi
if ! test -f /code/.without-coverage; then
COVER_ARGS="--cov=. --cov-append --cov-report=xml"
else
COVER_ARGS="--no-cov"
fi
# TODO: Review bot test failed without log-level set to debug
# TODO: due to memoize tests cannot be run together, otherwise it start failing
run_as_tester pytest $COVER_ARGS --log-level=DEBUG $file
done
set -x