[Qa-jenkins-scm] [jenkins.debian.net] 01/01: torbrowser tests: parse log for download problems, prevent concurrent runs

Holger Levsen holger at moszumanska.debian.org
Mon Nov 16 18:30:08 UTC 2015


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch master
in repository jenkins.debian.net.

commit ba2388ba622524f4feba0525cee1dfca612640ba
Author: Holger Levsen <holger at layer-acht.org>
Date:   Mon Nov 16 19:29:57 2015 +0100

    torbrowser tests: parse log for download problems, prevent concurrent runs
---
 TODO                             |  5 ++---
 bin/test_torbrowser-launcher.sh  | 16 ++++++++++++----
 job-cfg/torbrowser-launcher.yaml | 14 ++++++++++++++
 3 files changed, 28 insertions(+), 7 deletions(-)

diff --git a/TODO b/TODO
index 7a28c04..3977628 100644
--- a/TODO
+++ b/TODO
@@ -411,12 +411,11 @@ The following ideas should really only be implemented for the new 'lvc*' tests..
 
 === torbrowser-launcher_*
 
-* tee tbl-l output and grep for "Download error: Download Error: 404 Not Found" and fail earlier
 * not sure how to test updates. maybe just run in yesterdays schroot before upgrading
-* notifications to somewhere public
+* notifications should go somewhere public
 * debug why iceweasel is needed to be installed… and ca-certificates too.
 * run this in qemu and enable apparmor too?
-* test with python-pygame installed too?
+* probably not: test with python-pygame installed too?
 
 == Further ideas...
 
diff --git a/bin/test_torbrowser-launcher.sh b/bin/test_torbrowser-launcher.sh
index 4834db6..7a935e6 100755
--- a/bin/test_torbrowser-launcher.sh
+++ b/bin/test_torbrowser-launcher.sh
@@ -34,7 +34,7 @@ cleanup_all() {
 	fi
 	# delete main work dir
 	cd
-	rm $TMPDIR -r
+	rm $TMPDIR $TBL_LOGFILE -rf
 	# end
 	echo "$(date -u) - $TMPDIR deleted. Cleanup done."
 }
@@ -131,13 +131,13 @@ download_and_launch() {
 	echo "'$(date -u) - starting torbrowser tests'" | tee | xargs schroot --run-session -c $SESSION --preserve-environment -- notify-send
 	update_screenshot
 	echo "$(date -u) - starting torbrowser-launcher the first time, opening settings…"
-	( timeout -k 30m 29m schroot --run-session -c $SESSION --preserve-environment -- torbrowser-launcher --settings || true ) &
+	timeout -k 30m 29m schroot --run-session -c $SESSION --preserve-environment -- torbrowser-launcher --settings | tee $TBL_LOGFILE &
 	sleep 10
 	update_screenshot
 	echo "$(date -u) - pressing <tab>"
 	xvkbd -text "\t" > /dev/null 2>&1
 	sleep 1
-	TBL_VERSION=$(schroot --run-session -c $SESSION -- dpkg -l torbrowser-launcher | grep torbrowser-launcher | cut -b 25-34 | cut -d " " -f1)
+	TBL_VERSION=$(schroot --run-session -c $SESSION -- dpkg --status torbrowser-launcher |grep ^Version|cut -d " " -f2)
 	if dpkg --compare-versions $TBL_VERSION lt 0.2.0-1~ ; then
 		echo "$(date -u) - torbrowser-launcher version <0.2.0-1~ detected ($TBL_VERSION), pressing <tab> three times more>"
 		xvkbd -text "\t\t\t" > /dev/null 2>&1
@@ -161,7 +161,13 @@ download_and_launch() {
 	fi
 	for i in $(seq 1 20) ; do
 		sleep 30
-		update_screenshot
+		STATUS="$(grep '^Download error:' $TBL_LOGFILE || true)"
+		if [ -n "$STATUS" ] ; then
+			echo "'$(date -u) - $STATUS'" | tee | xargs schroot --run-session -c $SESSION --preserve-environment -- notify-send -u critical
+			update_screenshot
+			cleanup_duplicate_screenshots
+			exit 1
+		fi
 		# this directory only exist once torbrower has been successfully installed
 
 		STATUS="$(schroot --run-session -c $SESSION -- test ! -d $HOME/.local/share/torbrowser/tbb/x86_64/tor-browser_en-US/Browser || echo $(date -u ) - torbrowser downloaded and installed, configuring tor now. )"
@@ -171,6 +177,7 @@ download_and_launch() {
 			update_screenshot
 			break
 		fi
+		update_screenshot
 	done
 	if [ ! -n "$STATUS" ] ; then
 		echo "'$(date -u) - could not download torbrowser, please investigate.'" | tee | xargs schroot --run-session -c $SESSION --preserve-environment -- notify-send -u critical
@@ -250,6 +257,7 @@ if [ -z "$1" ] ; then
 fi
 SUITE=$1
 TMPDIR=$(mktemp -d)  # where everything actually happens
+TBL_LOGFILE=$(mktemp)
 SESSION="tbb-launcher-$SUITE-$(basename $TMPDIR)"
 STARTTIME=$(date +%Y%m%d%H%M)
 VIDEO=test-torbrowser-${SUITE}_$STARTTIME.mpg
diff --git a/job-cfg/torbrowser-launcher.yaml b/job-cfg/torbrowser-launcher.yaml
index 428d048..49c31d1 100644
--- a/job-cfg/torbrowser-launcher.yaml
+++ b/job-cfg/torbrowser-launcher.yaml
@@ -51,6 +51,13 @@
           url: http://www.profitbricks.co.uk
           text: Sponsored by Profitbricks
           icon: /userContent/images/profitbricks-24x24.png
+      - throttle:
+          max-total: 3
+          max-per-node: 1
+          enabled: true
+          option: category
+          categories:
+            - torbrowser-launcher
     description: '{my_description}<br>Job configuration source is <a href="http://anonscm.debian.org/cgit/qa/jenkins.debian.net.git/tree/job-cfg/torbrowser-launcher.yaml">torbrowser-launcher.yaml</a>.<br>Results are available at <a href="https://torbrowser-launcher.debian.net/">https://torbrowser-launcher.debian.net</a>.'
     logrotate:
       daysToKeep: 90
@@ -100,6 +107,13 @@
           url: http://www.profitbricks.co.uk
           text: Sponsored by Profitbricks
           icon: /userContent/images/profitbricks-24x24.png
+      - throttle:
+          max-total: 3
+          max-per-node: 1
+          enabled: true
+          option: category
+          categories:
+            - torbrowser-launcher
     description: '{my_description}<br>Job configuration source is <a href="http://anonscm.debian.org/cgit/qa/jenkins.debian.net.git/tree/job-cfg/torbrowser-launcher.yaml">torbrowser-launcher.yaml</a>.<br>Results are available at <a href="https://torbrowser-launcher.debian.net/">https://torbrowser-launcher.debian.net</a>.'
     logrotate:
       daysToKeep: 90

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list