mirror of
https://github.com/YunoHost/package_check.git
synced 2024-09-03 20:06:20 +02:00
Fixes following tests on the battlefield
This commit is contained in:
parent
f6cf30bffe
commit
79ea5f67c8
3 changed files with 15 additions and 12 deletions
|
@ -302,6 +302,7 @@ then
|
||||||
|
|
||||||
# Clone in another directory
|
# Clone in another directory
|
||||||
git clone --quiet https://github.com/YunoHost/package_linter "$script_dir/package_linter_tmp"
|
git clone --quiet https://github.com/YunoHost/package_linter "$script_dir/package_linter_tmp"
|
||||||
|
pip3 install pyparsing six
|
||||||
|
|
||||||
# And replace
|
# And replace
|
||||||
cp -a "$script_dir/package_linter_tmp/." "$script_dir/package_linter/."
|
cp -a "$script_dir/package_linter_tmp/." "$script_dir/package_linter/."
|
||||||
|
@ -310,6 +311,7 @@ then
|
||||||
else
|
else
|
||||||
echo -e "\e[97mInstall Package linter.\n\e[0m"
|
echo -e "\e[97mInstall Package linter.\n\e[0m"
|
||||||
git clone --quiet $git_repository "$script_dir/package_linter"
|
git clone --quiet $git_repository "$script_dir/package_linter"
|
||||||
|
pip3 install pyparsing six
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Update the version file
|
# Update the version file
|
||||||
|
|
|
@ -83,7 +83,7 @@ sudo apt-get update >> "$LOG_BUILD_LXC" 2>&1
|
||||||
sudo apt-get install -y lxc lxctl >> "$LOG_BUILD_LXC" 2>&1
|
sudo apt-get install -y lxc lxctl >> "$LOG_BUILD_LXC" 2>&1
|
||||||
|
|
||||||
echo -e "\e[1m> Install git, curl and lynx\e[0m" | tee -a "$LOG_BUILD_LXC"
|
echo -e "\e[1m> Install git, curl and lynx\e[0m" | tee -a "$LOG_BUILD_LXC"
|
||||||
sudo apt-get install -y git curl lynx >> "$LOG_BUILD_LXC" 2>&1
|
sudo apt-get install -y git curl lynx jq python3-pip >> "$LOG_BUILD_LXC" 2>&1
|
||||||
# For those who have disabled APT::Install-Recommends we need to manually install the following packages.
|
# For those who have disabled APT::Install-Recommends we need to manually install the following packages.
|
||||||
sudo apt-get install -y debootstrap rsync bridge-utils >> "$LOG_BUILD_LXC" 2>&1
|
sudo apt-get install -y debootstrap rsync bridge-utils >> "$LOG_BUILD_LXC" 2>&1
|
||||||
|
|
||||||
|
@ -193,7 +193,7 @@ done
|
||||||
|
|
||||||
echo -e "\e[1m> Update et install aptitude sudo git\e[0m" | tee -a "$LOG_BUILD_LXC"
|
echo -e "\e[1m> Update et install aptitude sudo git\e[0m" | tee -a "$LOG_BUILD_LXC"
|
||||||
sudo lxc-attach -n $LXC_NAME -- apt-get update
|
sudo lxc-attach -n $LXC_NAME -- apt-get update
|
||||||
sudo lxc-attach -n $LXC_NAME -- apt-get install -y aptitude sudo git ssh openssh-server jq
|
sudo lxc-attach -n $LXC_NAME -- apt-get install -y aptitude sudo git ssh openssh-server
|
||||||
echo -e "\e[1m> Installation des paquets standard et ssh-server\e[0m" | tee -a "$LOG_BUILD_LXC"
|
echo -e "\e[1m> Installation des paquets standard et ssh-server\e[0m" | tee -a "$LOG_BUILD_LXC"
|
||||||
sudo lxc-attach -n $LXC_NAME -- aptitude install -y ~pstandard ~prequired ~pimportant
|
sudo lxc-attach -n $LXC_NAME -- aptitude install -y ~pstandard ~prequired ~pimportant
|
||||||
|
|
||||||
|
|
|
@ -2003,12 +2003,12 @@ PACKAGE_LINTER () {
|
||||||
unit_test_title "Package linter..."
|
unit_test_title "Package linter..."
|
||||||
|
|
||||||
# Execute package linter and linter_result gets the return code of the package linter
|
# Execute package linter and linter_result gets the return code of the package linter
|
||||||
"$script_dir/package_linter/package_linter.py" "$package_path" > "$temp_result"
|
"$script_dir/package_linter/package_linter.py" "$package_path" > "$script_dir/temp_linter_result.log"
|
||||||
"$script_dir/package_linter/package_linter.py" "$package_path" --json > "$temp_result_json"
|
"$script_dir/package_linter/package_linter.py" "$package_path" --json > "$script_dir/temp_linter_result.json"
|
||||||
|
|
||||||
# Print the results of package linter and copy these result in the complete log
|
# Print the results of package linter and copy these result in the complete log
|
||||||
cat "$temp_result" | tee --append "$complete_log"
|
cat "$script_dir/temp_linter_result.log" | tee --append "$complete_log"
|
||||||
cat "$temp_result_json" >> "$complete_log"
|
cat "$script_dir/temp_linter_result.json" >> "$complete_log"
|
||||||
|
|
||||||
RESULT_linter_level_6=0
|
RESULT_linter_level_6=0
|
||||||
RESULT_linter_level_7=0
|
RESULT_linter_level_7=0
|
||||||
|
@ -2017,33 +2017,34 @@ PACKAGE_LINTER () {
|
||||||
# Check we qualify for level 6, 7, 8
|
# Check we qualify for level 6, 7, 8
|
||||||
# Linter will have a warning called "app_in_github_org" if app ain't in the
|
# Linter will have a warning called "app_in_github_org" if app ain't in the
|
||||||
# yunohost-apps org...
|
# yunohost-apps org...
|
||||||
if ! cat "$temp_result_json" | jq ".warning" | grep -q "app_in_github_org"
|
if ! cat "$script_dir/temp_linter_result.json" | jq ".warning" | grep -q "app_in_github_org"
|
||||||
then
|
then
|
||||||
RESULT_linter_level_6=1
|
RESULT_linter_level_6=1
|
||||||
fi
|
fi
|
||||||
if cat "$temp_result_json" | jq ".success" | grep -q "qualify_for_level_7"
|
if cat "$script_dir/temp_linter_result.json" | jq ".success" | grep -q "qualify_for_level_7"
|
||||||
then
|
then
|
||||||
RESULT_linter_level_7=1
|
RESULT_linter_level_7=1
|
||||||
fi
|
fi
|
||||||
if cat "$temp_result_json" | jq ".success" | grep -q "qualify_for_level_8"
|
if cat "$script_dir/temp_linter_result.json" | jq ".success" | grep -q "qualify_for_level_8"
|
||||||
then
|
then
|
||||||
RESULT_linter_level_8=1
|
RESULT_linter_level_8=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# If there are any critical errors, we'll force level 0
|
# If there are any critical errors, we'll force level 0
|
||||||
if [[ -z "$(cat "$temp_result_json" | jq ".critical" | grep -v "\[\]")" ]]
|
if [[ -n "$(cat "$script_dir/temp_linter_result.json" | jq ".critical" | grep -v '\[\]')" ]]
|
||||||
then
|
then
|
||||||
check_failed
|
check_failed
|
||||||
RESULT_linter=-2
|
RESULT_linter=-2
|
||||||
# If there are any regular errors, we'll cap to 4
|
# If there are any regular errors, we'll cap to 4
|
||||||
elif [[ -z "$(cat "$temp_result_json" | jq ".error" | grep -v "\[\]")" ]]
|
elif [[ -n "$(cat "$script_dir/temp_linter_result.json" | jq ".error" | grep -v '\[\]')" ]]
|
||||||
then # FAil
|
then # FAil
|
||||||
check_failed
|
check_failed
|
||||||
RESULT_linter=-1
|
RESULT_linter=-1
|
||||||
# Otherwise, test pass (we'll display a warning depending on if there are
|
# Otherwise, test pass (we'll display a warning depending on if there are
|
||||||
# any remaning warnings or not)
|
# any remaning warnings or not)
|
||||||
else
|
else
|
||||||
if [[ -z "$(cat "$temp_result_json" | jq ".warning" | grep -v "\[\]")" ]]
|
if [[ -n "$(cat "$script_dir/temp_linter_result.json" | jq ".warning" | grep -v '\[\]')" ]]
|
||||||
|
then
|
||||||
check_warning
|
check_warning
|
||||||
RESULT_linter=1
|
RESULT_linter=1
|
||||||
else
|
else
|
||||||
|
|
Loading…
Add table
Reference in a new issue