From edfbe3daf8de9513e44fc95a98615d87509da946 Mon Sep 17 00:00:00 2001 From: Tartare Bot Date: Tue, 29 Aug 2017 02:01:19 +0200 Subject: [PATCH] Fix applist + correctlt interpret test results --- appci/analyze.py | 5 ++- appci/apps | 98 ---------------------------------------------- appci/fetch.sh | 28 +++++++++++-- appci/fetchlist.py | 15 +++++++ appci/list_tests | 16 ++++++++ 5 files changed, 59 insertions(+), 103 deletions(-) delete mode 100644 appci/apps create mode 100644 appci/fetchlist.py create mode 100644 appci/list_tests diff --git a/appci/analyze.py b/appci/analyze.py index d7c869a..f9ac93d 100755 --- a/appci/analyze.py +++ b/appci/analyze.py @@ -18,6 +18,9 @@ def main(): data["name"] = app data["statuses"] = [] + if len(appdata.split("\n")) != 2: + print "Ignoring %s - bad/unavailable data" % app + continue applevel = appdata.split("\n")[1][0] appdata = appdata.split("\n")[0] data["level"] = int(applevel) @@ -39,7 +42,7 @@ def main(): apps.append(data) - apps.sort(key=lambda a: (a["level"], a["statusescore"], a["name"])), reverse=True) + apps.sort(key=lambda a: (a["level"], a["statusescore"], a["name"]), reverse=True) with open("apps.json", "w") as f: json.dump(apps, f) diff --git a/appci/apps b/appci/apps deleted file mode 100644 index 4b696fb..0000000 --- a/appci/apps +++ /dev/null @@ -1,98 +0,0 @@ -243 (Community) -abantecart (Community) -adminer (Community) -agendav (Official) -ampache (Community) -baikal (Official) -bozon (Community) -chtickynotes (Community) -cops (Community) -couchpotato (Community) -cryptpad (Community) -Cubiks-2048 (Community) -dokuwiki (Official) -etherpad mypads (Community) -filebin (Community) -framagames (Community) -freshrss (Community) -garradin (Community) -glowing bear (Community) -gogs (Community) -grafana (Community) -hextris (Official) -hotspot (Community) -htmltools (Community) -hubzilla (Community) -ihatemoney (Community) -jappix (Community) -jeedom (Community) -jenkins (Community) -jirafeau (Official) -Joomla (Community) -kanboard (Official) -keeweb (Community) -kiwiirc (Community) -laverna (Community) -LBCAlerte (Community) -leed (Community) -lektor (Community) -libresonic (Community) -limesurvey (Community) -linuxdash (Community) -lstu (Community) -lufi (Community) -lutim (Community) -mattermost (Community) -minchat (Community) -minidlna (Community) -monica (Community) -monit (Community) -monitorix (Community) -movim (Community) -multi webapp (Community) -mumbleserver (Community) -my webapp (Official) -mytinytodo (Community) -netdata (Community) -nextcloud (Official) -nexusoss (Community) -opensondage (Official) -osjs (Community) -owncloud (Community) -phpmyadmin (Official) -phpsysinfo (Community) -piratebox (Community) -piwigo (Community) -radicale (Community) -rainloop (Official) -riot (Community) -roundcube (Official) -rss-bridge (Community) -scrumblr (Community) -seafile (Community) -searx (Official) -shaarli (Community) -shellinabox (Official) -shout (Community) -shuri (Community) -simpad (Community) -spip (Community) -spip2 (Community) -staticwebapp (Community) -strut (Official) -synapse (Community) -tagspaces (Community) -torclient (Community) -transmission (Official) -ttrss (Official) -vpnclient (Community) -wallabag2 (Official) -webapp multi (Community) -Webtrees (Community) -wordpress (Official) -yourls (Community) -Youtube-dl-WebUI (Community) -yunofav (Community) -z-push (Community) -zerobin (Official) -zeronet (Community) diff --git a/appci/fetch.sh b/appci/fetch.sh index 7db0fb8..7bcc17f 100755 --- a/appci/fetch.sh +++ b/appci/fetch.sh @@ -1,16 +1,36 @@ #!/bin/bash +python fetchlist.py | sort > list_apps + while read APP; do APPNAME=$(echo $APP | awk '{print $1}') echo $APPNAME wget -q -O data/$APPNAME "https://ci-apps.yunohost.org/jenkins/job/$APP/lastBuild/consoleText" --prefer-family=IPv4 - CHECKS=$(cat data/$APPNAME | grep "Package linter:" -A15 | tail -n 16 | sed -e 's/FAIL/0/g' -e 's/SUCCESS/1/g' -e 's/Not evaluated./X/' | awk '{print $NF}' | tr -d '\n') - LEVELS=$(cat data/$APPNAME | grep 'Level of this application' -A10 | tail -n 11 | sed -e 's@N/A@X@g' -e 's/ Level //g' -e 's/Level of this application//g' | awk '{print $2}' | tr -d '\n') + TESTS_RESULTS="" + while read TESTNAME + do + RESULTS=$(grep "^$TESTNAME:" data/$APPNAME) + if echo $RESULTS | grep -q "FAIL" + then + TESTS_RESULTS="${TESTS_RESULTS}0" + elif echo $RESULTS | grep -q "SUCCESS" + then + TESTS_RESULTS="${TESTS_RESULTS}1" + else + TESTS_RESULTS="${TESTS_RESULTS}X" + fi + done < list_tests - echo $CHECKS > data/$APPNAME + LEVELS=$(grep -A10 'Level of this application' data/$APPNAME \ + | tail -n 11 \ + | sed -e 's@N/A@X@g' -e 's/ Level //g' -e 's/Level of this application//g' \ + | awk '{print $2}' \ + | tr -d '\n') + + echo $TESTS_RESULTS > data/$APPNAME echo $LEVELS >> data/$APPNAME -done < apps +done < list_apps diff --git a/appci/fetchlist.py b/appci/fetchlist.py new file mode 100644 index 0000000..c63c19c --- /dev/null +++ b/appci/fetchlist.py @@ -0,0 +1,15 @@ + +import os +import json +import requests + +official = json.loads(requests.get("https://raw.githubusercontent.com/YunoHost/apps/master/official.json").text) +community = json.loads(requests.get("https://raw.githubusercontent.com/YunoHost/apps/master/community.json").text) + +official_apps = [ os.path.basename(app["url"]).replace("_ynh", "")+" (Official)" for app in official.values() ] +community_apps = [ os.path.basename(app["url"]).replace("_ynh", "")+" (Community)" for app in community.values() if app["state"] == "working" ] + +for app in official_apps: + print app +for app in community_apps: + print app diff --git a/appci/list_tests b/appci/list_tests new file mode 100644 index 0000000..4fc5c2a --- /dev/null +++ b/appci/list_tests @@ -0,0 +1,16 @@ +Package linter +Installation +Deleting +Installation in a sub path +Deleting from a sub path +Installation on the root +Deleting from root +Upgrade +Installation in private mode +Installation in public mode +Multi-instance installations +Malformed path +Port already used +Backup +Restore +Change URL