Skip to content
Extraits de code Groupes Projets
Valider e8bf4a38 rédigé par mattab's avatar mattab
Parcourir les fichiers

calling travis_wait to work around "No output has been received in the last 10 minutes"

this potentially indicates a stalled build or something wrong with the build itself.
https://travis-ci.org/piwik/piwik/jobs/25761087#L252
parent 084dafb3
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
#!/bin/bash
# Sourced from https://github.com/travis-ci/travis-build/blob/master/lib/travis/build/script/templates/header.sh
# + Tweaked to display output and not show the status line
travis_wait() {
local timeout=$1
if [[ $timeout =~ ^[0-9]+$ ]]; then
# looks like an integer, so we assume it's a timeout
shift
else
# default value
timeout=20
fi
local cmd="$@"
local log_file=travis_wait_$$.log
$cmd
local cmd_pid=$!
travis_jigger $! $timeout $cmd &
local jigger_pid=$!
local result
{
wait $cmd_pid 2>/dev/null
result=$?
ps -p$jigger_pid &>/dev/null && kill $jigger_pid
} || return 1
if [ $result -eq 0 ]; then
echo -e "\n${GREEN}The command \"$TRAVIS_CMD\" exited with $result.${RESET}"
else
echo -e "\n${RED}The command \"$TRAVIS_CMD\" exited with $result.${RESET}"
fi
echo -e "\n${GREEN}Log:${RESET}\n"
cat $log_file
return $result
}
travis_jigger() {
# helper method for travis_wait()
local cmd_pid=$1
shift
local timeout=$1 # in minutes
shift
local count=0
# clear the line
echo -e "\n"
while [ $count -lt $timeout ]; do
count=$(($count + 1))
#echo -ne "Still running ($count of $timeout): $@\r"
sleep 60
done
echo -e "\n${RED}Timeout (${timeout} minutes) reached. Terminating \"$@\"${RESET}\n"
kill -9 $cmd_pid
}
\ No newline at end of file
#!/bin/bash #!/bin/bash
if [ "$TEST_SUITE" != "UITests" ] && [ "$TEST_SUITE" != "AngularJSTests" ] # for travis_wait function
then source travis-helper.sh
if [ `phpunit --group __nogroup__ | grep "No tests executed" | wc -l` -ne 1 ]
then
echo "=====> There are some tests functions which do not have a @group set. "
echo " Please add the @group phpdoc comment to the following tests: <====="
phpunit --group __nogroup__ --testdox | grep "[x]"
exit 1
fi
fi
if [ -n "$TEST_SUITE" ] if [ -n "$TEST_SUITE" ]
then then
...@@ -49,5 +41,6 @@ then ...@@ -49,5 +41,6 @@ then
fi fi
fi fi
else else
phpunit --configuration phpunit.xml --coverage-text --colors travis_wait phpunit --configuration phpunit.xml --coverage-text --colors
fi fi
\ No newline at end of file
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter