Fix sdk/cwl tests after commit 9df4d7da24ef8be639af1ab806cf833ee544fb45
[arvados.git] / sdk / cwl / test_with_arvbox.sh
1 #!/bin/sh
2
3 if ! which arvbox >/dev/null ; then
4     export PATH=$PATH:$(readlink -f $(dirname $0)/../../tools/arvbox/bin)
5 fi
6
7 reset_container=1
8 leave_running=0
9 config=dev
10
11 while test -n "$1" ; do
12     arg="$1"
13     case "$arg" in
14         --no-reset-container)
15             reset_container=0
16             shift
17             ;;
18         --leave-running)
19             leave_running=1
20             shift
21             ;;
22         --config)
23             config=$2
24             shift ; shift
25             ;;
26         -*)
27             break
28             ;;
29     esac
30 done
31
32 if test -z "$ARVBOX_CONTAINER" ; then
33    export ARVBOX_CONTAINER=cwltest
34 fi
35
36 if test $reset_container = 1 ; then
37     arvbox reset -f
38 fi
39
40 arvbox start $config
41
42 arvbox pipe <<EOF
43 set -eu -o pipefail
44
45 . /usr/local/lib/arvbox/common.sh
46
47 cd /usr/src/arvados/sdk/cwl
48 python setup.py sdist
49 pip_install \$(ls dist/arvados-cwl-runner-*.tar.gz | tail -n1)
50
51 mkdir -p /tmp/cwltest
52 cd /tmp/cwltest
53 if ! test -d common-workflow-language ; then
54   git clone https://github.com/common-workflow-language/common-workflow-language.git
55 fi
56 cd common-workflow-language
57 git pull
58 export ARVADOS_API_HOST=localhost:8000
59 export ARVADOS_API_HOST_INSECURE=1
60 export ARVADOS_API_TOKEN=\$(cat /var/lib/arvados/superuser_token)
61 env
62 exec ./run_test.sh "$@"
63 EOF
64
65 CODE=$?
66
67 if test $leave_running = 0 ; then
68     arvbox stop
69 fi
70
71 exit $CODE