tests.sh 1.06 KB
Newer Older
1
#!/bin/sh
2
3
set -e

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
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
    if coverage >/dev/null 2>&1; then
      coverage run $TEST
      coverage report --include=snf-*
    else
      echo "WARNING: Cannot find coverage in path, skipping coverage tests" 1>&2
      $TEST
    fi
}

export SYNNEFO_SETTINGS_DIR=/tmp/snf-test-settings

ASTAKOS_APPS="im quotaholder_app"
CYCLADES_APPS="api db logic plankton quotas vmapi helpdesk"
PITHOS_APPS="api"

TEST_COMPONENTS="$@"
if [ -z "$TEST_COMPONENTS" ]; then
    TEST_COMPONENTS="astakos cyclades pithos"
28
fi
29
30
31
32
33

for component in $TEST_COMPONENTS; do
    if [ "$component" = "astakos" ]; then
        runtest $ASTAKOS_APPS
    elif [ "$component" = "cyclades" ]; then
Christos Stavrakakis's avatar
Christos Stavrakakis committed
34
35
        export SYNNEFO_EXCLUDE_PACKAGES="snf-pithos-app"
        runtest $CYCLADES_APPS
36
    elif [ "$component" = "pithos" ]; then
Christos Stavrakakis's avatar
Christos Stavrakakis committed
37
38
        export SYNNEFO_EXCLUDE_PACKAGES="snf-cyclades-app"
        runtest $PITHOS_APPS
39
40
    fi
done