This commit is contained in:
Alexandre Aubin 2020-12-02 20:17:28 +01:00
parent 14908abbd5
commit ad437c4030
2 changed files with 19 additions and 18 deletions

View file

@ -864,7 +864,7 @@ initialize_values() {
fi
# Number of tests to proceed
all_test=0
total_number_of_test=0
# Default path
test_path=/
@ -969,7 +969,7 @@ then
initialize_values
# Break after the first tests serie
if [ $all_test -ne 0 ] && [ $bash_mode -ne 1 ]; then
if [ $total_number_of_test -ne 0 ] && [ $bash_mode -ne 1 ]; then
read -p "Press a key to start the next tests serie..." < /dev/tty
fi
@ -1102,7 +1102,7 @@ then
count_test () {
# Increase the number of test, if this test is set at 1.
test "$1" -eq 1 && all_test=$((all_test+1))
test "$1" -eq 1 && total_number_of_test=$((total_number_of_test+1))
}
# Get standard options
@ -1208,7 +1208,7 @@ else
multi_instance=1
port_already_use=0
change_url=0
all_test=$((all_test+9))
total_number_of_test=$((total_number_of_test+9))
# Read each arguments and store them
@ -1251,7 +1251,7 @@ else
count_test () {
# Decrease the number of test, if this test is not already removed.
if [ $1 -eq 1 ]; then
all_test=$((all_test-1))
total_number_of_test=$((total_number_of_test-1))
return 1
fi
}
@ -1276,7 +1276,7 @@ else
error "The manifest key for public was not found."
setup_private=0
setup_public=0
all_test=$((all_test-2))
total_number_of_test=$((total_number_of_test-2))
fi
# Remove the multi-instance test if this parameter is set at false in the manifest.
if grep multi_instance "$package_path/manifest.json" | grep -q false

View file

@ -179,7 +179,7 @@ REMOVE_APP () {
VALIDATE_THAT_APP_CAN_BE_ACCESSED () {
# Not checking this if this ain't relevant for the current test / app
if [ $use_curl -ne 1 ]
if [ $enable_validate_that_app_can_be_accessed == "true" ]
then
curl_error=0
yuno_portal=0
@ -430,10 +430,10 @@ VALIDATE_THAT_APP_CAN_BE_ACCESSED () {
start_test () {
title "$1 [Test $cur_test/$all_test]"
title "$1 [Test $current_test_number/$total_number_of_test]"
# Increment the value of the current test
cur_test=$((cur_test+1))
current_test_number=$((current_test_number+1))
}
replace_manifest_key () {
@ -534,8 +534,6 @@ CHECK_SETUP () {
start_test "Installation on the root"
else
start_test "Installation without url access"
# Disable the curl test
use_curl=0
fi
# Copy original arguments
@ -1785,7 +1783,7 @@ TEST_LAUNCHER () {
if [ $false_positive_error_loop -lt $max_false_positive_error_loop ]
then
warning "The test will restart."
cur_test=$((cur_test-1))
current_test_number=$((current_test_number-1))
fi
fi
@ -1937,10 +1935,13 @@ TESTING_PROCESS () {
PRINT_YUNOHOST_VERSION
# Init the value for the current test
cur_test=1
current_test_number=1
# By default, all tests will try to access the app with curl
use_curl=1
# We will chech that the app can be accessed
# (except if it's a no-url app)
[ $setup_nourl -eq 0 ] \
&& enable_validate_that_app_can_be_accessed="true" \
||enable_validate_that_app_can_be_accessed="false"
# Check the package with package linter
[ $pkg_linter -eq 1 ] && PACKAGE_LINTER