mirror of
https://github.com/YunoHost/package_check.git
synced 2024-09-03 20:06:20 +02:00
Add --dry-run option to debug what tests are going to be ran exactly
This commit is contained in:
parent
0b71d81f91
commit
1ba05dda6d
2 changed files with 17 additions and 1 deletions
|
@ -57,6 +57,14 @@ run_all_tests() {
|
||||||
read -p "Press a key to start the tests..." < /dev/tty
|
read -p "Press a key to start the tests..." < /dev/tty
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ $dry_run -eq 1 ]; then
|
||||||
|
for FILE in $(ls $TEST_CONTEXT/tests/*.json)
|
||||||
|
do
|
||||||
|
cat $FILE | jq
|
||||||
|
done
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
# Launch all tests successively
|
# Launch all tests successively
|
||||||
cat $TEST_CONTEXT/tests/*.json >> /proc/self/fd/3
|
cat $TEST_CONTEXT/tests/*.json >> /proc/self/fd/3
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@ print_help() {
|
||||||
-a, --arch=ARCH
|
-a, --arch=ARCH
|
||||||
-d, --dist=DIST
|
-d, --dist=DIST
|
||||||
-y, --ynh-branch=BRANCH
|
-y, --ynh-branch=BRANCH
|
||||||
|
-D, --dry-run Show a JSON representing which tests are going to be ran (meant for debugging)
|
||||||
-i, --interactive Wait for the user to continue before each remove
|
-i, --interactive Wait for the user to continue before each remove
|
||||||
-e, --interactive-on-errors Wait for the user to continue on errors
|
-e, --interactive-on-errors Wait for the user to continue on errors
|
||||||
-s, --force-stop Force the stop of running package_check
|
-s, --force-stop Force the stop of running package_check
|
||||||
|
@ -35,6 +36,7 @@ exit 0
|
||||||
[ "$#" -eq 0 ] && print_help
|
[ "$#" -eq 0 ] && print_help
|
||||||
|
|
||||||
gitbranch=""
|
gitbranch=""
|
||||||
|
dry_run=0
|
||||||
interactive=0
|
interactive=0
|
||||||
interactive_on_errors=0
|
interactive_on_errors=0
|
||||||
rebuild=0
|
rebuild=0
|
||||||
|
@ -54,6 +56,7 @@ function parse_args() {
|
||||||
fi
|
fi
|
||||||
# For each argument in the array, reduce to short argument for getopts
|
# For each argument in the array, reduce to short argument for getopts
|
||||||
arguments[$i]=${arguments[$i]//--interactive/-i}
|
arguments[$i]=${arguments[$i]//--interactive/-i}
|
||||||
|
arguments[$i]=${arguments[$i]//--dry-run/-D}
|
||||||
arguments[$i]=${arguments[$i]//--rebuild/-r}
|
arguments[$i]=${arguments[$i]//--rebuild/-r}
|
||||||
arguments[$i]=${arguments[$i]//--force-stop/-s}
|
arguments[$i]=${arguments[$i]//--force-stop/-s}
|
||||||
arguments[$i]=${arguments[$i]//--help/-h}
|
arguments[$i]=${arguments[$i]//--help/-h}
|
||||||
|
@ -71,7 +74,7 @@ function parse_args() {
|
||||||
# Initialize the index of getopts
|
# Initialize the index of getopts
|
||||||
OPTIND=1
|
OPTIND=1
|
||||||
# Parse with getopts only if the argument begin by -
|
# Parse with getopts only if the argument begin by -
|
||||||
getopts ":b:iresh" parameter || true
|
getopts ":b:Diresh" parameter || true
|
||||||
case $parameter in
|
case $parameter in
|
||||||
b)
|
b)
|
||||||
# --branch=branch-name
|
# --branch=branch-name
|
||||||
|
@ -83,6 +86,11 @@ function parse_args() {
|
||||||
interactive=1
|
interactive=1
|
||||||
shift_value=1
|
shift_value=1
|
||||||
;;
|
;;
|
||||||
|
D)
|
||||||
|
# --dry-run
|
||||||
|
dry_run=1
|
||||||
|
shift_value=1
|
||||||
|
;;
|
||||||
e)
|
e)
|
||||||
# --interactive-on-errors
|
# --interactive-on-errors
|
||||||
interactive_on_errors=1
|
interactive_on_errors=1
|
||||||
|
|
Loading…
Add table
Reference in a new issue