diff --git a/lib/tests_coordination.sh b/lib/tests_coordination.sh index 4e90f56..40510b9 100644 --- a/lib/tests_coordination.sh +++ b/lib/tests_coordination.sh @@ -313,7 +313,9 @@ TEST_LAUNCHER () { # Execute the test $test_type $test_arg - [ $? -eq 0 ] && SET_RESULT "success" main_result || SET_RESULT "failure" main_result + local test_result=$? + + [ $test_result -eq 0 ] && SET_RESULT "success" main_result || SET_RESULT "failure" main_result # Check that we don't have this message characteristic of a file that got manually modified, # which should not happen during tests because no human modified the file ... @@ -383,7 +385,7 @@ at_least_one_install_succeeded () { break_before_continue () { - if [ $interactive -eq 1 ] + if [ $interactive -eq 1 ] || [ $interactive_on_errors -eq 1 ] && [ ! $test_result -eq 0 ] then echo "To enter a shell on the lxc:" echo " lxc exec $LXC_NAME bash" diff --git a/package_check.sh b/package_check.sh index 27dc1c4..674415c 100755 --- a/package_check.sh +++ b/package_check.sh @@ -9,13 +9,18 @@ print_help() { cat << EOF Usage: package_check.sh [OPTION]... PACKAGE_TO_CHECK - -b, --branch=BRANCH Specify a branch to check. - -i, --interactive Wait for the user to continue before each remove. - -s, --force-stop Force the stop of running package_check - -r, --rebuild (Re)Build the base container - (N.B.: you're not supposed to use this option, images - are supposed to be fetch from devbaseimgs.yunohost.org automatically) - -h, --help Display this help + -b, --branch=BRANCH Specify a branch to check. + -a, --arch=ARCH + -d, --dist=DIST + -y, --ynh-branch=BRANCH + -i, --interactive Wait for the user to continue before each remove + -e, --interactive-on-errors Wait for the user to continue on errors + -s, --force-stop Force the stop of running package_check + -r, --rebuild (Re)Build the base container + (N.B.: you're not supposed to use this option, + images are supposed to be fetch from + devbaseimgs.yunohost.org automatically) + -h, --help Display this help EOF exit 0 } @@ -31,6 +36,7 @@ exit 0 gitbranch="" interactive=0 +interactive_on_errors=0 rebuild=0 force_stop=0 @@ -65,7 +71,7 @@ function parse_args() { # Initialize the index of getopts OPTIND=1 # Parse with getopts only if the argument begin by - - getopts ":b:irsh" parameter || true + getopts ":b:iresh" parameter || true case $parameter in b) # --branch=branch-name @@ -77,6 +83,11 @@ function parse_args() { interactive=1 shift_value=1 ;; + e) + # --interactive-on-errors + interactive_on_errors=1 + shift_value=1 + ;; r) # --rebuild rebuild=1