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)
21 while test -n "$1" ; do
61 echo "$0 [--no-reset-container] [--leave-running] [--config dev|localdemo] [--tag docker_tag] [--build] [--pythoncmd python(2|3)] [--suite (integration|conformance-v1.0|conformance-*)]"
70 if test -z "$ARVBOX_CONTAINER" ; then
71 export ARVBOX_CONTAINER=cwltest
74 if test "$suite" = "conformance" ; then
75 suite=conformance-v1.0
78 if test $reset_container = 1 ; then
80 docker rm $ARVBOX_CONTAINER
84 arvbox start $config $tag
86 docker cp $(readlink -f $(dirname $0)/tests) $ARVBOX_CONTAINER:/usr/src/arvados/sdk/cwl/tests
91 . /usr/local/lib/arvbox/common.sh
93 export PYCMD=$pythoncmd
95 if test $config = dev ; then
96 cd /usr/src/arvados/sdk/cwl
97 \$PYCMD setup.py sdist
98 pip_install \$(ls -r dist/arvados-cwl-runner-*.tar.gz | head -n1)
103 if [ "\$PYCMD" = "python3" ]; then
109 mkdir -p /tmp/cwltest
112 if [[ "$suite" = "conformance-v1.0" ]] ; then
113 if ! test -d common-workflow-language ; then
114 git clone https://github.com/common-workflow-language/common-workflow-language.git
116 cd common-workflow-language
117 elif [[ "$suite" =~ conformance-(.*) ]] ; then
118 version=\${BASH_REMATCH[1]}
119 if ! test -d cwl-\${version} ; then
120 git clone https://github.com/common-workflow-language/cwl-\${version}.git
123 git checkout \${version}.0
124 elif [[ "$suite" != "integration" ]] ; then
125 echo "ERROR: unknown suite '$suite'"
129 #if [[ "$suite" != "integration" ]] ; then
133 export ARVADOS_API_HOST=localhost:8000
134 export ARVADOS_API_HOST_INSECURE=1
135 export ARVADOS_API_TOKEN=\$(cat /var/lib/arvados-arvbox/superuser_token)
137 if test -n "$build" ; then
138 /usr/src/arvados/build/build-dev-docker-jobs-image.sh
139 elif test "$tag" = "latest" ; then
140 arv-keepdocker --pull arvados/jobs $tag
143 export WORKSPACE=/usr/src/arvados
144 . /usr/src/arvados/build/run-library.sh
148 # This defines python_sdk_version and cwl_runner_version with python-style
149 # package suffixes (.dev/rc)
150 calculate_python_sdk_cwl_package_versions
155 arv-keepdocker --pull arvados/jobs \$cwl_runner_version
156 docker tag arvados/jobs:\$cwl_runner_version arvados/jobs:latest
157 arv-keepdocker arvados/jobs latest
160 EXTRA=--compute-checksum
162 if [[ $devcwl -eq 1 ]] ; then
163 EXTRA="\$EXTRA --enable-dev"
167 if [[ "$suite" = "integration" ]] ; then
168 cd /usr/src/arvados/sdk/cwl/tests
169 exec ./arvados-tests.sh $@
170 elif [[ "$suite" = "conformance-v1.2" ]] ; then
171 exec cwltest --tool arvados-cwl-runner --test conformance_tests.yaml -Sdocker_entrypoint,timelimit_invalid_wf -N307 $@ -- \$EXTRA
172 elif [[ "$suite" = "conformance-v1.1" ]] ; then
173 exec cwltest --tool arvados-cwl-runner --test conformance_tests.yaml -Sdocker_entrypoint,timelimit_invalid_wf -N199 $@ -- \$EXTRA
174 elif [[ "$suite" = "conformance-v1.0" ]] ; then
175 exec cwltest --tool arvados-cwl-runner --test v1.0/conformance_test_v1.0.yaml -Sdocker_entrypoint $@ -- \$EXTRA
181 if test $leave_running = 0 ; then