Don't attempt to run tests unless start file is successful

remotes/origin/fix-delete-homeidr-on-userdelete
Robin McCorkell 2015-09-23 23:18:16 +07:00 committed by Thomas Müller
parent 8467dbfa91
commit ad028c555d
2 changed files with 46 additions and 41 deletions

@ -19,6 +19,12 @@ user=smb-test
password=!owncloud123 password=!owncloud123
host=WIN-9GTFAS08C15 host=WIN-9GTFAS08C15
if ! (nc -c -w 1 ${host} 445 </dev/null >&/dev/null \
|| nc -w 1 ${host} 445 </dev/null >&/dev/null); then
echo "[ERROR] Server not reachable" >&2
exit 1
fi
cat > $thisFolder/config.smb.php <<DELIM cat > $thisFolder/config.smb.php <<DELIM
<?php <?php

@ -175,57 +175,56 @@ EOF
fi fi
if [ -n "$2" -a "$2" == "common-tests" ]; then if [ -n "$2" -a "$2" == "common-tests" ]; then
return; return;
fi fi
FILES_EXTERNAL_BACKEND_PATH=../apps/files_external/tests/backends FILES_EXTERNAL_BACKEND_PATH=../apps/files_external/tests/backends
FILES_EXTERNAL_BACKEND_ENV_PATH=../apps/files_external/tests/env FILES_EXTERNAL_BACKEND_ENV_PATH=../apps/files_external/tests/env
for startFile in `ls -1 $FILES_EXTERNAL_BACKEND_ENV_PATH | grep start`; do for startFile in `ls -1 $FILES_EXTERNAL_BACKEND_ENV_PATH | grep start`; do
name=`echo $startFile | sed 's/start-//' | sed 's/\.sh//'` name=`echo $startFile | sed 's/start-//' | sed 's/\.sh//'`
if [ -n "$2" -a "$2" != "$name" ]; then if [ -n "$2" -a "$2" != "$name" ]; then
echo "skip: $startFile" echo "skip: $startFile"
continue; continue;
fi fi
echo "start: $startFile" echo "start: $startFile"
echo "name: $name" echo "name: $name"
# execute start file # execute start file
./$FILES_EXTERNAL_BACKEND_ENV_PATH/$startFile if ./$FILES_EXTERNAL_BACKEND_ENV_PATH/$startFile; then
# getting backend to test from filename
# getting backend to test from filename # it's the part between the dots startSomething.TestToRun.sh
# it's the part between the dots startSomething.TestToRun.sh testToRun=`echo $startFile | cut -d '-' -f 2`
testToRun=`echo $startFile | cut -d '-' -f 2`
# run the specific test
# run the specific test if [ -z "$NOCOVERAGE" ]; then
if [ -z "$NOCOVERAGE" ]; then rm -rf "coverage-external-html-$1-$name"
rm -rf "coverage-external-html-$1-$name" mkdir "coverage-external-html-$1-$name"
mkdir "coverage-external-html-$1-$name" "$PHPUNIT" --configuration phpunit-autotest-external.xml --log-junit "autotest-external-results-$1-$name.xml" --coverage-clover "autotest-external-clover-$1-$name.xml" --coverage-html "coverage-external-html-$1-$name" "$FILES_EXTERNAL_BACKEND_PATH/$testToRun.php"
"$PHPUNIT" --configuration phpunit-autotest-external.xml --log-junit "autotest-external-results-$1-$name.xml" --coverage-clover "autotest-external-clover-$1-$name.xml" --coverage-html "coverage-external-html-$1-$name" "$FILES_EXTERNAL_BACKEND_PATH/$testToRun.php" RESULT=$?
RESULT=$? else
else echo "No coverage"
echo "No coverage" "$PHPUNIT" --configuration phpunit-autotest-external.xml --log-junit "autotest-external-results-$1-$name.xml" "$FILES_EXTERNAL_BACKEND_PATH/$testToRun.php"
"$PHPUNIT" --configuration phpunit-autotest-external.xml --log-junit "autotest-external-results-$1-$name.xml" "$FILES_EXTERNAL_BACKEND_PATH/$testToRun.php" RESULT=$?
RESULT=$? fi
fi fi
# calculate stop file # calculate stop file
stopFile=`echo "$startFile" | sed 's/start/stop/'` stopFile=`echo "$startFile" | sed 's/start/stop/'`
echo "stop: $stopFile" echo "stop: $stopFile"
if [ -f $FILES_EXTERNAL_BACKEND_ENV_PATH/$stopFile ]; then if [ -f $FILES_EXTERNAL_BACKEND_ENV_PATH/$stopFile ]; then
# execute stop file if existant # execute stop file if existant
./$FILES_EXTERNAL_BACKEND_ENV_PATH/$stopFile ./$FILES_EXTERNAL_BACKEND_ENV_PATH/$stopFile
fi fi
done; done;
} }
# #
# start test execution # start test execution
# #
if [ -z "$1" ] if [ -z "$1" ]; then
then
# run all known database configs # run all known database configs
for DBCONFIG in $DBCONFIGS; do for DBCONFIG in $DBCONFIGS; do
execute_tests $DBCONFIG "$2" execute_tests $DBCONFIG "$2"