[Qa-jenkins-scm] [Git][qa/jenkins.debian.net][master] reproducible Archlinux: fixup csv statistic storage

Holger Levsen gitlab at salsa.debian.org
Tue Sep 25 22:05:20 BST 2018


Holger Levsen pushed to branch master at Debian QA / jenkins.debian.net


Commits:
a4406fec by Holger Levsen at 2018-09-25T21:04:38Z
reproducible Archlinux: fixup csv statistic storage

Signed-off-by: Holger Levsen <holger at layer-acht.org>

- - - - -


1 changed file:

- bin/reproducible_html_archlinux.sh


Changes:

=====================================
bin/reproducible_html_archlinux.sh
=====================================
@@ -37,15 +37,16 @@ HEIGHT=960
 for REPOSITORY in $ARCHLINUX_REPOS ; do
 	echo "$(date -u) - starting to analyse build results for '$REPOSITORY'."
 	# prepare stats per repository
-	TOTAL=$(cat ${ARCHLINUX_PKGS}_$REPOSITORY | wc -l)
-	TESTED=$(cat $ARCHBASE/$REPOSITORY/*/pkg.state | grep -c ^ || true )
-	NR_GOOD=$(cat $ARCHBASE/$REPOSITORY/*/pkg.state | grep -c GOOD || true )
-	NR_FTBR=$(cat $ARCHBASE/$REPOSITORY/*/pkg.state | grep -c FTBR || true )
-	NR_FTBFS=$(cat $ARCHBASE/$REPOSITORY/*/pkg.state | grep -c FTBFS || true )
-	NR_DEPWAIT=$(cat $ARCHBASE/$REPOSITORY/*/pkg.state | grep -c DEPWAIT || true )
-	NR_404=$(cat $ARCHBASE/$REPOSITORY/*/pkg.state | grep -c 404 || true )
-	NR_BLACKLISTED=$(cat $ARCHBASE/$REPOSITORY/*/pkg.state | grep -c BLACKLISTED || true )
-	NR_UNKNOWN=$(cat $ARCHBASE/$REPOSITORY/*/pkg.state | grep -c UNKNOWN || true )
+	SUITE="archlinux_$REPOSITORY"
+	TOTAL=$(query_db "SELECT count(*) FROM sources AS s WHERE s.architecture='x86_64' AND s.suite='$SUITE';")
+	TESTED=$(query_db "SELECT count(*) FROM sources AS s JOIN results AS r ON s.id=r.package_id WHERE s.architecture='x86_64' AND s.suite='$SUITE';")
+	NR_GOOD=$(query_db "SELECT count(*) FROM sources AS s JOIN results AS r ON s.id=r.package_id WHERE s.architecture='x86_64' AND s.suite='$SUITE' AND r.status='GOOD';")
+	NR_FTBR=$(query_db "SELECT count(*) FROM sources AS s JOIN results AS r ON s.id=r.package_id WHERE s.architecture='x86_64' AND s.suite='$SUITE' AND r.status LIKE 'FTBR_%';")
+	NR_FTBFS=$(query_db "SELECT count(*) FROM sources AS s JOIN results AS r ON s.id=r.package_id WHERE s.architecture='x86_64' AND s.suite='$SUITE' AND r.status LIKE 'FTBFS_%';")
+	NR_DEPWAIT=$(query_db "SELECT count(*) FROM sources AS s JOIN results AS r ON s.id=r.package_id WHERE s.architecture='x86_64' AND s.suite='$SUITE' AND r.status LIKE 'DEPWAIT_%';")
+	NR_404=$(query_db "SELECT count(*) FROM sources AS s JOIN results AS r ON s.id=r.package_id WHERE s.architecture='x86_64' AND s.suite='$SUITE' AND r.status LIKE '404_%';")
+	NR_BLACKLISTED=$(query_db "SELECT count(*) FROM sources AS s JOIN results AS r ON s.id=r.package_id WHERE s.architecture='x86_64' AND s.suite='$SUITE' AND r.status='BLACKLISTED';")
+	NR_UNKNOWN=$(query_db "SELECT count(*) FROM sources AS s JOIN results AS r ON s.id=r.package_id WHERE s.architecture='x86_64' AND s.suite='$SUITE' AND r.status='404';")
 	PERCENT_TOTAL=$(echo "scale=1 ; ($TESTED*100/$TOTAL)" | bc)
 	if [ $(echo $PERCENT_TOTAL/1|bc) -lt 99 ] ; then
 		NR_TESTED="$TESTED <span style=\"font-size:0.8em;\">(tested $PERCENT_TOTAL% of $TOTAL)</span>"
@@ -129,6 +130,8 @@ if [ ! -f $IMAGE ] || [ $ARCHBASE/archlinux.csv -nt $IMAGE ] ; then
 	irc_message archlinux-reproducible "Daily graphs on $REPRODUCIBLE_URL/archlinux/ updated, $(echo "scale=1 ; ($ARCHLINUX_NR_GOOD*100/$ARCHLINUX_TESTED)" | bc)% reproducible packages in our current test framework."
 fi
 
+exit 0
+
 #
 # write out the actual webpage
 #
@@ -178,7 +181,4 @@ write_page "</div></div>"
 write_page_footer 'Arch Linux'
 echo "$(date -u) - enjoy $REPRODUCIBLE_URL/archlinux/$PAGE"
 
-echo "$(date -u) - Sleeping 5min now to prevent immediate restart of this job…"
-sleep 5m
-
 # vim: set sw=0 noet :



View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/commit/a4406fec269f2fc42eb1d250aa9a0bbc8ddbf685

-- 
View it on GitLab: https://salsa.debian.org/qa/jenkins.debian.net/commit/a4406fec269f2fc42eb1d250aa9a0bbc8ddbf685
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/qa-jenkins-scm/attachments/20180925/35648ad5/attachment-0001.html>


More information about the Qa-jenkins-scm mailing list