Statistics
| Branch: | Tag: | Revision:

root / ci / tests.sh @ 7877e6d3

History | View | Annotate | Download (1.3 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_RELAX_MANDATORY_SETTINGS=1
20
export ASTAKOS_BASE_URL='https://astakos.example.synnefo.org/accounts'
21
export CYCLADES_BASE_URL='https://cyclades.example.synnefo.org/compute'
22
export PITHOS_BASE_URL='https://pithos.example.synnefo.org/object-store'
23
export SYNNEFO_SETTINGS_DIR=/etc/synnefo-test-settings
24

    
25
ASTAKOS_APPS="im quotaholder_app"
26
CYCLADES_APPS="api db logic plankton quotas vmapi helpdesk"
27
PITHOS_APPS="api"
28

    
29
TEST_COMPONENTS="$@"
30
if [ -z "$TEST_COMPONENTS" ]; then
31
    TEST_COMPONENTS="astakos cyclades pithos"
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
    fi
44
done