~nuclearbob/uci-engine/removed-bootspeed-zeroes

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/sh -e
# Ubuntu CI Engine
# Copyright 2014 Canonical Ltd.

# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU Affero General Public License version 3, as
# published by the Free Software Foundation.

# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranties of
# MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
# PURPOSE.  See the GNU Affero General Public License for more details.

# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

# REQUIRES: python-pip python-virtualenv python-setuptools python-dev make

. ./setup.sh $@

# setup activates the env where the tests are executed

FAILURES=0

for x in $SERVICES ; do
	echo "== Testing $x ...."
	if ! ./$x/setup.py test ; then
            echo "== Testing FAILED for $x =="
            FAILURES=$(( ${FAILURES} + 1 ))
        else
            echo "== Testing SUCCEEDED for $x =="            
        fi
done

GLUE_TESTS='
./juju-deployer/update.py --assert-pinned
./juju-deployer/test_update.py
./juju-deployer/test_deploy.py
'
# Do not want to parse newlines as the internal field separator. It would break
# any test with arguments.
SAVE="$IFS"
IFS='
'
for test_command in $GLUE_TESTS; do
    echo "== Testing $test_command ...."
    # test_deploy needs user set, but its presence shouldn't hurt the other
    # tests.
    # Use eval, as $test_command may have arguments.
    if ! USER=foo eval "$test_command" ; then
        echo "== Testing FAILED for $test_command =="
        FAILURES=$(( ${FAILURES} + 1 ))
    else
        echo "== Testing SUCCEEDED for $test_command =="            
    fi
done
IFS="$SAVE"

# If any test failed, fail the whole script
if [ "$FAILURES" != "0" ] ; then
    # We can't get the number of *tests* that failed, only the number of
    # runs
    echo "Number of test suite failures: $FAILURES"
fi
exit $FAILURES