Statistics
| Branch: | Tag: | Revision:

root / ci / tests.sh @ fcfef550

History | View | Annotate | Download (1 kB)

1 cd391e22 Christos Stavrakakis
#!/bin/sh
2 ca0a879c Christos Stavrakakis
set -e
3 ca0a879c Christos Stavrakakis
4 43cdd0c4 Vangelis Koukis
SNF_MANAGE=$(which snf-manage) ||
5 c4f9764f Vangelis Koukis
	{ echo "Cannot find snf-manage in $PATH" 1>&2; exit 1; }
6 34262911 Kostas Papadimitriou
7 762a924a Georgios D. Tsoukalas
runtest () {
8 0ab2fa42 Christos Stavrakakis
    TEST="$SNF_MANAGE test $* --traceback --noinput --settings=synnefo.settings.test"
9 ca0a879c Christos Stavrakakis
10 762a924a Georgios D. Tsoukalas
    if coverage >/dev/null 2>&1; then
11 762a924a Georgios D. Tsoukalas
      coverage run $TEST
12 762a924a Georgios D. Tsoukalas
      coverage report --include=snf-*
13 762a924a Georgios D. Tsoukalas
    else
14 762a924a Georgios D. Tsoukalas
      echo "WARNING: Cannot find coverage in path, skipping coverage tests" 1>&2
15 762a924a Georgios D. Tsoukalas
      $TEST
16 762a924a Georgios D. Tsoukalas
    fi
17 762a924a Georgios D. Tsoukalas
}
18 762a924a Georgios D. Tsoukalas
19 762a924a Georgios D. Tsoukalas
export SYNNEFO_SETTINGS_DIR=/tmp/snf-test-settings
20 762a924a Georgios D. Tsoukalas
21 762a924a Georgios D. Tsoukalas
ASTAKOS_APPS="im quotaholder_app"
22 762a924a Georgios D. Tsoukalas
CYCLADES_APPS="api db logic plankton quotas vmapi helpdesk"
23 762a924a Georgios D. Tsoukalas
PITHOS_APPS="api"
24 762a924a Georgios D. Tsoukalas
25 762a924a Georgios D. Tsoukalas
TEST_COMPONENTS="$@"
26 762a924a Georgios D. Tsoukalas
if [ -z "$TEST_COMPONENTS" ]; then
27 5079dec2 Christos Stavrakakis
    TEST_COMPONENTS="astakos cyclades"
28 ca0a879c Christos Stavrakakis
fi
29 762a924a Georgios D. Tsoukalas
30 762a924a Georgios D. Tsoukalas
for component in $TEST_COMPONENTS; do
31 762a924a Georgios D. Tsoukalas
    if [ "$component" = "astakos" ]; then
32 762a924a Georgios D. Tsoukalas
        runtest $ASTAKOS_APPS
33 762a924a Georgios D. Tsoukalas
    elif [ "$component" = "cyclades" ]; then
34 96ba8bae Christos Stavrakakis
        export SYNNEFO_EXCLUDE_PACKAGES="snf-pithos-app"
35 96ba8bae Christos Stavrakakis
        runtest $CYCLADES_APPS
36 762a924a Georgios D. Tsoukalas
    elif [ "$component" = "pithos" ]; then
37 96ba8bae Christos Stavrakakis
        export SYNNEFO_EXCLUDE_PACKAGES="snf-cyclades-app"
38 96ba8bae Christos Stavrakakis
        runtest $PITHOS_APPS
39 762a924a Georgios D. Tsoukalas
    fi
40 762a924a Georgios D. Tsoukalas
done