openSUSE-release-tools/dist/ci/docker-compose-test.sh
Stephan Kulow 8ba4e2fb84 Run the nosetests in a tumbleweed container instead of travis environment
The docker-compose file starts an OBS instance (on 15.0 atm) and runs
the test suite in a test container (tumbleweed), so all tests run in
an isolated environment accessing OBS at api:3000
2019-05-04 15:44:39 +02:00

31 lines
784 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
for file in tests/*_tests.py; do
if test -f /code/travis.settings; then
COVER_ARGS="--with-coverage --cover-package=. --cover-inclusive"
fi
run_as_tester nosetests $COVER_ARGS -c .noserc -s $file
done
set -x
if test -f /code/travis.settings; then
source /code/travis.settings
# ignore if coveralls was not setup for the repo/branch
run_as_tester TRAVIS_JOB_ID=$TRAVIS_JOB_ID TRAVIS_BRANCH=$TRAVIS_BRANCH TRAVIS_PULL_REQUEST=$TRAVIS_PULL_REQUEST TRAVIS=yes coveralls || true
fi