annotate deploy/test/smoketest.sh @ 1600:ed9c467ef922 dockerise

Add hggit extension
author Chris Cannam
date Wed, 23 Aug 2017 11:32:50 +0100
parents eeacb8332051
children 2496b955f638
rev   line source
Chris@1596 1 #!/bin/bash
Chris@1596 2
Chris@1596 3 # The big problem with this test script is that it needs the cron
Chris@1596 4 # scripts that generate some of this stuff to have been run at least
Chris@1596 5 # once
Chris@1596 6
Chris@1596 7 usage() {
Chris@1596 8 echo 1>&2
Chris@1596 9 echo "Usage: $0 <uri-base>" 1>&2
Chris@1596 10 echo 1>&2
Chris@1596 11 echo " e.g. $0 https://code.soundsoftware.ac.uk" 1>&2
Chris@1596 12 echo " or $0 http://localhost:8080" 1>&2
Chris@1596 13 echo 1>&2
Chris@1596 14 exit 2
Chris@1596 15 }
Chris@1596 16
Chris@1596 17 uribase="$1"
Chris@1596 18 if [ -z "$uribase" ]; then
Chris@1596 19 usage
Chris@1596 20 fi
Chris@1596 21
Chris@1596 22 set -eu
Chris@1596 23
Chris@1597 24 # A project known to exist, be public, and have a repository
Chris@1597 25 project_with_repo=vamp-plugin-sdk
Chris@1597 26
Chris@1597 27 # A project known to exist, be public, and have embedded documentation
Chris@1597 28 project_with_docs=vamp-plugin-sdk
Chris@1597 29
Chris@1597 30 # A project known to exist, be public, and have a bibliography
Chris@1597 31 project_with_biblio=sonic-visualiser
Chris@1596 32
Chris@1596 33 tried=0
Chris@1596 34 succeeded=0
Chris@1596 35
Chris@1596 36 mydir=$(dirname "$0")
Chris@1596 37
Chris@1596 38 try() {
Chris@1596 39 mkdir -p "$mydir/output"
Chris@1596 40 origin=$(pwd)
Chris@1596 41 cd "$mydir/output"
Chris@1596 42 path="$1"
Chris@1596 43 description="$2"
Chris@1596 44 url="$uribase$path"
Chris@1596 45 echo
Chris@1596 46 echo "Trying \"$description\" [$url]..."
Chris@1596 47 echo
Chris@1596 48 if wget "$url" ; then
Chris@1596 49 echo "+++ Succeeded"
Chris@1596 50 succeeded=$(($succeeded + 1))
Chris@1596 51 else
Chris@1596 52 echo "--- FAILED"
Chris@1596 53 fi
Chris@1597 54 tried=$(($tried + 1))
Chris@1597 55 cd "$origin"
Chris@1596 56 }
Chris@1596 57
Chris@1596 58 try "/" "Front page"
Chris@1597 59 try "/projects/$project_with_repo" "Project page"
Chris@1597 60 try "/projects/$project_with_biblio" "Project page with bibliography"
Chris@1597 61 try "/projects/$project_with_repo/repository" "Repository page"
Chris@1597 62 try "/hg/$project_with_repo" "Mercurial repo"
Chris@1597 63 try "/projects/$project_with_docs/embedded" "Project documentation page (from docgen cron script)"
Chris@1597 64 try "/git/$project_with_repo/info/refs" "Git repo mirror"
Chris@1596 65
Chris@1596 66 echo
Chris@1596 67 echo "Passed $succeeded of $tried"
Chris@1596 68 echo
Chris@1596 69