2 # Copyright (C) The Arvados Authors. All rights reserved.
4 # SPDX-License-Identifier: Apache-2.0
8 if ! which arvbox >/dev/null ; then
9 export PATH=$PATH:$(readlink -f $(dirname $0)/../../tools/arvbox/bin)
20 while test -n "$1" ; do
56 echo "$0 [--no-reset-container] [--leave-running] [--config dev|localdemo] [--tag docker_tag] [--build] [--pythoncmd python(2|3)] [--suite (integration|conformance-v1.0|conformance-v1.1)]"
65 if test -z "$ARVBOX_CONTAINER" ; then
66 export ARVBOX_CONTAINER=cwltest
69 if test "$suite" = "conformance" ; then
70 suite=conformance-v1.0
73 if test $reset_container = 1 ; then
75 docker rm $ARVBOX_CONTAINER
79 arvbox start $config $tag
84 . /usr/local/lib/arvbox/common.sh
86 export PYCMD=$pythoncmd
88 if test $config = dev ; then
89 cd /usr/src/arvados/sdk/cwl
90 \$PYCMD setup.py sdist
91 pip_install \$(ls -r dist/arvados-cwl-runner-*.tar.gz | head -n1)
96 if [ \$PYCMD = "python3" ]; then
102 mkdir -p /tmp/cwltest
105 if [[ "$suite" = "conformance-v1.0" ]] ; then
106 if ! test -d common-workflow-language ; then
107 git clone https://github.com/common-workflow-language/common-workflow-language.git
109 cd common-workflow-language
110 elif [[ "$suite" = "conformance-v1.1" ]] ; then
111 if ! test -d cwl-v1.1 ; then
112 git clone https://github.com/common-workflow-language/cwl-v1.1.git
117 if [[ "$suite" != "integration" ]] ; then
121 export ARVADOS_API_HOST=localhost:8000
122 export ARVADOS_API_HOST_INSECURE=1
123 export ARVADOS_API_TOKEN=\$(cat /var/lib/arvados/superuser_token)
125 if test -n "$build" ; then
126 /usr/src/arvados/build/build-dev-docker-jobs-image.sh
127 elif test "$tag" = "latest" ; then
128 arv-keepdocker --pull arvados/jobs $tag
130 jobsimg=\$(curl https://versions.arvados.org/v1/commit/$tag | python -c "import json; import sys; sys.stdout.write(json.load(sys.stdin)['Versions']['Docker']['arvados/jobs'])")
131 arv-keepdocker --pull arvados/jobs \$jobsimg
132 docker tag arvados/jobs:\$jobsimg arvados/jobs:latest
133 arv-keepdocker arvados/jobs latest
136 cat >/tmp/cwltest/arv-cwl-jobs <<EOF2
138 exec arvados-cwl-runner --api=jobs \\\$@
140 chmod +x /tmp/cwltest/arv-cwl-jobs
142 cat >/tmp/cwltest/arv-cwl-containers <<EOF2
144 exec arvados-cwl-runner --api=containers \\\$@
146 chmod +x /tmp/cwltest/arv-cwl-containers
149 if [[ "$suite" = "integration" ]] ; then
150 cd /usr/src/arvados/sdk/cwl/tests
151 exec ./arvados-tests.sh $@
153 exec ./run_test.sh RUNNER=/tmp/cwltest/arv-cwl-${runapi} EXTRA=--compute-checksum $@
159 if test $leave_running = 0 ; then