2 # Copyright (C) The Arvados Authors. All rights reserved.
4 # SPDX-License-Identifier: Apache-2.0
8 cwldir=$(readlink -f $(dirname $0))
10 if ! which arvbox >/dev/null ; then
11 export PATH=$PATH:$cwldir/../../tools/arvbox/bin
23 while test -n "$1" ; do
55 echo "warning: --pythoncmd option is no longer supported; ignored" >&2
67 echo "$0 [--no-reset-container] [--leave-running] [--config dev|localdemo] [--tag docker_tag] [--build] [--suite (integration|conformance-v1.0|conformance-*)]"
76 if test -z "$ARVBOX_CONTAINER" ; then
77 export ARVBOX_CONTAINER=cwltest
80 if test "$suite" = "conformance" ; then
81 suite=conformance-v1.0
84 if test $reset_container = 1 ; then
86 docker rm $ARVBOX_CONTAINER
90 arvbox start $config $tag
92 # Copy the integration test suite from our local arvados clone instead
93 # of using the one inside the container, so we can make changes to the
94 # integration tests without necessarily having to rebuilding the
96 docker cp -L $cwldir/tests $ARVBOX_CONTAINER:/usr/src/arvados/sdk/cwl
101 . /usr/local/lib/arvbox/common.sh
103 if test $config = dev -o $reinstall = 1; then
104 pip_install_sdist sdk/python sdk/cwl
109 # 2.3.20230527113600 release of cwltest confirms that files exist on disk, since
110 # our files are in Keep, all the tests fail.
111 # We should add [optional] Arvados support to cwltest so it can access
112 # Keep but for the time being just install the last working version.
113 # This version depends on setuptools, but does not declare that, so we install
114 # it ourselves to ensure it's available. That can be removed at the same time
115 # we upgrade the cwltest version.
116 /opt/arvados-py/bin/pip install 'cwltest<2.3.20230527113600' setuptools
118 mkdir -p /tmp/cwltest
121 if [[ "$suite" = "conformance-v1.0" ]] ; then
122 if ! test -d common-workflow-language ; then
123 git clone https://github.com/common-workflow-language/common-workflow-language.git
125 cd common-workflow-language
126 elif [[ "$suite" =~ conformance-(.*) ]] ; then
127 version=\${BASH_REMATCH[1]}
128 if ! test -d cwl-\${version} ; then
129 git clone https://github.com/common-workflow-language/cwl-\${version}.git
132 git checkout \${version}.0
133 elif [[ "$suite" != "integration" ]] ; then
134 echo "ERROR: unknown suite '$suite'"
138 if [[ "$suite" = "conformance-v1.1" ]] ; then
142 if [[ "$suite" = "conformance-v1.2" ]] ; then
146 #if [[ "$suite" != "integration" ]] ; then
150 export ARVADOS_API_HOST=localhost:8000
151 export ARVADOS_API_HOST_INSECURE=1
152 export ARVADOS_API_TOKEN=\$(cat /var/lib/arvados-arvbox/superuser_token)
154 if test -n "$build" ; then
155 /usr/src/arvados/build/build-dev-docker-jobs-image.sh
158 EXTRA=--compute-checksum
160 if [[ $devcwl -eq 1 ]] ; then
161 EXTRA="\$EXTRA --enable-dev"
166 arvados-cwl-runner --version
169 # Skip docker_entrypoint test because it fails on singularity
171 # Skip timelimit_invalid_wf test because the timeout is very short
172 # (5s) and singularity containers loading off an arv-mount take too long
173 # to start and get incorrectly terminated
175 # Skip test 199 in the v1.1 suite because it has different output
176 # depending on whether there is a pty associated with stdout (fixed in
179 if [[ "$suite" = "integration" ]] ; then
180 cd /usr/src/arvados/sdk/cwl/tests
181 exec ./arvados-tests.sh $@
182 elif [[ "$suite" = "conformance-v1.2" ]] ; then
183 exec cwltest --tool arvados-cwl-runner --test conformance_tests.yaml -Sdocker_entrypoint --badgedir /tmp/badges $@ -- \$EXTRA
184 elif [[ "$suite" = "conformance-v1.1" ]] ; then
185 exec cwltest --tool arvados-cwl-runner --test conformance_tests.yaml -Sdocker_entrypoint,timelimit_invalid_wf -N199 --badgedir /tmp/badges $@ -- \$EXTRA
186 elif [[ "$suite" = "conformance-v1.0" ]] ; then
187 exec cwltest --tool arvados-cwl-runner --test v1.0/conformance_test_v1.0.yaml -Sdocker_entrypoint --badgedir /tmp/badges $@ -- \$EXTRA
193 docker cp -L $ARVBOX_CONTAINER:/tmp/badges $cwldir/badges
195 if test $leave_running = 0 ; then