root / ci / tests.sh @ 9f41ab1e
History | View | Annotate | Download (1.2 kB)
1 |
#!/bin/sh |
---|---|
2 |
set -e |
3 |
|
4 |
SNF_MANAGE=$(which snf-manage) || |
5 |
{ echo "Cannot find snf-manage in $PATH" 1>&2; exit 1; } |
6 |
|
7 |
runTest () { |
8 |
TEST="$SNF_MANAGE test $* --traceback --noinput --settings=synnefo.settings.test" |
9 |
|
10 |
runCoverage "$TEST" |
11 |
} |
12 |
|
13 |
runCoverage () { |
14 |
if coverage >/dev/null 2>&1; then |
15 |
coverage run $1 |
16 |
coverage report --include=snf-* |
17 |
else |
18 |
echo "WARNING: Cannot find coverage in path, skipping coverage tests" 1>&2 |
19 |
$1 |
20 |
fi |
21 |
} |
22 |
|
23 |
export SYNNEFO_SETTINGS_DIR=/tmp/snf-test-settings |
24 |
|
25 |
ASTAKOS_APPS="im quotaholder_app" |
26 |
CYCLADES_APPS="api db logic plankton quotas vmapi helpdesk userdata" |
27 |
PITHOS_APPS="api" |
28 |
|
29 |
TEST_COMPONENTS="$@" |
30 |
if [ -z "$TEST_COMPONENTS" ]; then |
31 |
TEST_COMPONENTS="astakos cyclades pithos astakosclient" |
32 |
fi |
33 |
|
34 |
for component in $TEST_COMPONENTS; do |
35 |
if [ "$component" = "astakos" ]; then |
36 |
runTest $ASTAKOS_APPS |
37 |
elif [ "$component" = "cyclades" ]; then |
38 |
export SYNNEFO_EXCLUDE_PACKAGES="snf-pithos-app" |
39 |
runTest $CYCLADES_APPS |
40 |
elif [ "$component" = "pithos" ]; then |
41 |
export SYNNEFO_EXCLUDE_PACKAGES="snf-cyclades-app" |
42 |
runTest $PITHOS_APPS |
43 |
elif [ "$component" = "astakosclient" ]; then |
44 |
TEST="nosetests astakosclient" |
45 |
runCoverage "$TEST" |
46 |
fi |
47 |
done |