Statistics
| Branch: | Tag: | Revision:

root / ci / tests.sh @ 762a924a

History | View | Annotate | Download (1.1 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 --settings=synnefo.settings.test"
9

    
10
    if coverage >/dev/null 2>&1; then
11
      coverage run $TEST
12
      coverage report --include=snf-*
13
    else
14
      echo "WARNING: Cannot find coverage in path, skipping coverage tests" 1>&2
15
      $TEST
16
    fi
17
}
18

    
19
export SYNNEFO_SETTINGS_DIR=/tmp/snf-test-settings
20

    
21
ASTAKOS_APPS="im quotaholder_app"
22
CYCLADES_APPS="api db logic plankton quotas vmapi helpdesk"
23
PITHOS_APPS="api"
24

    
25
TEST_COMPONENTS="$@"
26
if [ -z "$TEST_COMPONENTS" ]; then
27
    TEST_COMPONENTS="astakos cyclades pithos"
28
fi
29

    
30
for component in $TEST_COMPONENTS; do
31
    if [ "$component" = "astakos" ]; then
32
        runtest $ASTAKOS_APPS
33
    elif [ "$component" = "cyclades" ]; then
34
        SYNNEFO_EXCLUDE_PACKAGES="$SYNNEFO_EXCLUDE_PACKAGES snf-pithos-app" \
35
            runtest $CYCLADES_APPS
36
    elif [ "$component" = "pithos" ]; then
37
        SYNNEFO_EXCLUDE_PACKAGES="$SYNNEFO_EXCLUDE_PACKAGES snf-cyclades-app" \
38
            runtest $PITHOS_APPS
39
    fi
40
done