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 githead=$(git rev-parse HEAD)
97 . /usr/local/lib/arvbox/common.sh
99 # Switch to the branch that the outer script is running from,
100 # this ensures we get the right version of tests and a-c-r
102 git config --global --add safe.directory /usr/src/arvados
104 git checkout -f $githead
106 if test $config = dev -o $reinstall = 1; then
107 pip_install_sdist sdk/python sdk/cwl
112 # Starting with the 2.5.20241122133319 release of cwltest, it looks
113 # for an entry point declared as cwltest.fsaccess and will use that
114 # for file access. As of 2024-11-25 arvados-cwl-runner publishes this
115 # entry point so that cwltest uses CollectionFsAccess, allowing cwltest to
116 # check that files exist in Keep.
117 /opt/arvados-py/bin/pip install 'cwltest >=2.5.20241122133319,<3'
119 mkdir -p /tmp/cwltest
122 if [[ "$suite" = "conformance-v1.0" ]] ; then
123 if ! test -d common-workflow-language ; then
124 git clone https://github.com/common-workflow-language/common-workflow-language.git
126 cd common-workflow-language
127 elif [[ "$suite" =~ conformance-(.*) ]] ; then
128 version=\${BASH_REMATCH[1]}
129 if ! test -d cwl-\${version} ; then
130 git clone https://github.com/common-workflow-language/cwl-\${version}.git
133 git checkout \${version}.0
134 elif [[ "$suite" != "integration" ]] ; then
135 echo "ERROR: unknown suite '$suite'"
139 if [[ "$suite" = "conformance-v1.1" ]] ; then
143 if [[ "$suite" = "conformance-v1.2" ]] ; then
147 #if [[ "$suite" != "integration" ]] ; then
151 export ARVADOS_API_HOST=localhost:8000
152 export ARVADOS_API_HOST_INSECURE=1
153 export ARVADOS_API_TOKEN=\$(cat /var/lib/arvados-arvbox/superuser_token)
155 if test -n "$build" ; then
156 /usr/src/arvados/build/build-dev-docker-jobs-image.sh
159 EXTRA=--compute-checksum
161 if [[ $devcwl -eq 1 ]] ; then
162 EXTRA="\$EXTRA --enable-dev"
167 arvados-cwl-runner --version
170 # Skip docker_entrypoint test because it fails on singularity
172 # Skip timelimit_invalid_wf test because the timeout is very short
173 # (5s) and singularity containers loading off an arv-mount take too long
174 # to start and get incorrectly terminated
176 # Skip test 199 in the v1.1 suite because it has different output
177 # depending on whether there is a pty associated with stdout (fixed in
180 if [[ "$suite" = "integration" ]] ; then
181 cd /usr/src/arvados/sdk/cwl/tests
182 exec ./arvados-tests.sh $@
183 elif [[ "$suite" = "conformance-v1.2" ]] ; then
184 exec cwltest --tool arvados-cwl-runner --test conformance_tests.yaml -Sdocker_entrypoint --badgedir /tmp/badges $@ -- \$EXTRA
185 elif [[ "$suite" = "conformance-v1.1" ]] ; then
186 exec cwltest --tool arvados-cwl-runner --test conformance_tests.yaml -Sdocker_entrypoint,timelimit_invalid_wf -N199 --badgedir /tmp/badges $@ -- \$EXTRA
187 elif [[ "$suite" = "conformance-v1.0" ]] ; then
188 exec cwltest --tool arvados-cwl-runner --test v1.0/conformance_test_v1.0.yaml -Sdocker_entrypoint --badgedir /tmp/badges $@ -- \$EXTRA
194 docker cp -L $ARVBOX_CONTAINER:/tmp/badges $cwldir/badges
196 if test $leave_running = 0 ; then