~pwlars/ubuntu-test-cases/krillin-recovery

« back to all changes in this revision

Viewing changes to scripts/run-autopilot-tests.sh

  • Committer: Andy Doan
  • Date: 2014-01-07 17:56:16 UTC
  • Revision ID: andy.doan@canonical.com-20140107175616-hazstr3a5x75d021
add ability to optionally update the dashboard in realtime

if the right combination of environment variables are provided to
this script then we'll update the dashboard with realtime status
of a smoke run.

Variables needed by a job to enable this are:

  DASHBOARD_HOST
  DASHBOARD_USER
  DASHBOARD_KEY

Optional values are:

  DASHBOARD_PORT
  DASHBOARD_PREFIX

Show diffs side-by-side

added added

removed removed

Lines of Context:
107
107
        fi
108
108
}
109
109
 
 
110
dashboard_update() {
 
111
        # only try and update the dashboard if we are configured to
 
112
        [ -z $DASHBOARD_KEY ] && return 0
 
113
        [ -z $DASHBOARD_BUILD ] && return 0
 
114
        [ -z $DASHBOARD_IMAGE ] && return 0
 
115
        ${BASEDIR}/scripts/dashboard.py $* \
 
116
                --image $DASHBOARD_IMAGE \
 
117
                --build $DASHBOARD_BUILD || true
 
118
}
 
119
 
 
120
dashboard_result_running() {
 
121
        dashboard_update result-running --test $1
 
122
}
 
123
 
 
124
dashboard_result_syncing() {
 
125
        xunit=${RESDIR}/${app}/test_results.xml
 
126
        [ -f $xunit ] || return 0
 
127
        summary=$(cat clientlogs/friends_app/test_results.xml | grep "<testsuite")
 
128
        errors=$(echo $summary | grep -Po '(?<=errors=")\d+')
 
129
        tests=$(echo $summary | grep -Po '(?<=tests=")\d+')
 
130
        fails=$(echo $summary | grep -Po '(?<=failures=")\d+')
 
131
        errors=$(echo $summary | grep -Po '(?<=errors=")\d+')
 
132
 
 
133
        dashboard_update result-syncing --test $1 \
 
134
                --errors $errors --fails $fails --tests $tests
 
135
}
 
136
 
110
137
main() {
111
138
        # print the build date so the jenkins job can use it as the
112
139
        # build description
123
150
                echo "= testing $app"
124
151
                echo "========================================================"
125
152
                set -x
 
153
                dashboard_result_running $app
126
154
                reboot_wait
127
155
 
128
156
                grab_powerd
136
164
                        adb wait-for-device
137
165
                        test_app $app
138
166
                fi
 
167
                dashboard_result_syncing $app
139
168
 
140
169
                release_powerd
141
170
        done