[Travis] Ensure fatal error makes job failing

This commit is contained in:
Kamil Kokot 2016-04-27 15:53:16 +02:00
parent 987cc50b64
commit 41051b0130
No known key found for this signature in database
GPG key ID: 7BD76F7054D93C89
2 changed files with 28 additions and 12 deletions

View file

@ -26,19 +26,27 @@ prepare_for_behat_with_js() {
}
run_brand_new_behat() {
local code=0
print_header "Testing (Behat - brand new, javascript scenarios; @javascript && ~@legacy && ~@todo && ~@cli)" "Sylius"
run_command "bin/behat --strict -f progress -p cached --tags=\"@javascript && ~@legacy && ~@todo && ~@cli\""
if [[ $? = 1 ]]; then
run_command "bin/behat --strict -f progress -p cached --tags=\"@javascript && ~@legacy && ~@todo && ~@cli\" --rerun"
run_command "bin/behat --strict -f progress -p cached --tags=\"@javascript && ~@legacy && ~@todo && ~@cli\"" || code=$?
if [[ ${code} = 1 ]]; then
run_command "bin/behat --strict -f progress -p cached --tags=\"@javascript && ~@legacy && ~@todo && ~@cli\" --rerun" ; code=$?
fi
return ${code}
}
run_legacy_behat() {
local code=0
print_header "Testing (Behat - legacy, javascript scenarios; @javascript && @legacy && ~@todo && ~@cli)" "Sylius"
run_command "bin/behat --strict -f progress -p cached --tags=\"@javascript && @legacy && ~@todo && ~@cli\""
if [[ $? = 1 ]]; then
run_command "bin/behat --strict -f progress -p cached --tags=\"@javascript && @legacy && ~@todo && ~@cli\" --rerun"
run_command "bin/behat --strict -f progress -p cached --tags=\"@javascript && @legacy && ~@todo && ~@cli\"" || code=$?
if [[ ${code} = 1 ]]; then
run_command "bin/behat --strict -f progress -p cached --tags=\"@javascript && @legacy && ~@todo && ~@cli\" --rerun" ; code=$?
fi
return ${code}
}
run_behat() {

View file

@ -3,19 +3,27 @@
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/../../../../bash/common.lib.sh"
run_brand_new_behat() {
local code=0
print_header "Testing (Behat - brand new, regular scenarios; ~@javascript && ~@legacy && ~@todo && ~@cli)" "Sylius"
run_command "bin/behat --strict -f progress -p cached --tags=\"~@javascript && ~@legacy && ~@todo && ~@cli\""
if [[ $? = 1 ]]; then
run_command "bin/behat --strict -f progress -p cached --tags=\"~@javascript && ~@legacy && ~@todo && ~@cli\" --rerun"
run_command "bin/behat --strict -f progress -p cached --tags=\"~@javascript && ~@legacy && ~@todo && ~@cli\"" || code=$?
if [[ ${code} = 1 ]]; then
run_command "bin/behat --strict -f progress -p cached --tags=\"~@javascript && ~@legacy && ~@todo && ~@cli\" --rerun" ; code=$?
fi
return ${code}
}
run_legacy_behat() {
local code=0
print_header "Testing (Behat - legacy, regular scenarios; ~@javascript && @legacy && ~@todo && ~@cli)" "Sylius"
run_command "bin/behat --strict -f progress -p cached --tags=\"~@javascript && @legacy && ~@todo && ~@cli\""
if [[ $? = 1 ]]; then
run_command "bin/behat --strict -f progress -p cached --tags=\"~@javascript && @legacy && ~@todo && ~@cli\" --rerun" || EXIT_CODE=$?
run_command "bin/behat --strict -f progress -p cached --tags=\"~@javascript && @legacy && ~@todo && ~@cli\"" || code=$?
if [[ ${code} = 1 ]]; then
run_command "bin/behat --strict -f progress -p cached --tags=\"~@javascript && @legacy && ~@todo && ~@cli\" --rerun" ; code=$?
fi
return ${code}
}
run_behat() {