Merge branch '21666-provision-test-improvement'
[arvados.git] / sdk / cwl / test_with_arvbox.sh
index 55099afdf766c33cad9a6fee3503fc7173524491..51d64b3f84c8dc4c36e2dd637be9b622a8afaa3c 100755 (executable)
@@ -5,8 +5,10 @@
 
 set -x
 
+cwldir=$(readlink -f $(dirname $0))
+
 if ! which arvbox >/dev/null ; then
-    export PATH=$PATH:$(readlink -f $(dirname $0)/../../tools/arvbox/bin)
+    export PATH=$PATH:$cwldir/../../tools/arvbox/bin
 fi
 
 reset_container=1
@@ -14,7 +16,6 @@ leave_running=0
 config=dev
 devcwl=0
 tag="latest"
-pythoncmd=python3
 suite=conformance
 runapi=containers
 reinstall=0
@@ -51,7 +52,7 @@ while test -n "$1" ; do
             shift
             ;;
         --pythoncmd)
-            pythoncmd=$2
+            echo "warning: --pythoncmd option is no longer supported; ignored" >&2
             shift ; shift
             ;;
         --suite)
@@ -63,7 +64,7 @@ while test -n "$1" ; do
             shift ; shift
             ;;
         -h|--help)
-            echo "$0 [--no-reset-container] [--leave-running] [--config dev|localdemo] [--tag docker_tag] [--build] [--pythoncmd python(2|3)] [--suite (integration|conformance-v1.0|conformance-*)]"
+            echo "$0 [--no-reset-container] [--leave-running] [--config dev|localdemo] [--tag docker_tag] [--build] [--suite (integration|conformance-v1.0|conformance-*)]"
             exit
             ;;
         *)
@@ -92,23 +93,15 @@ arvbox start $config $tag
 # of using the one inside the container, so we can make changes to the
 # integration tests without necessarily having to rebuilding the
 # container image.
-docker cp -L $(readlink -f $(dirname $0)/tests) $ARVBOX_CONTAINER:/usr/src/arvados/sdk/cwl
+docker cp -L $cwldir/tests $ARVBOX_CONTAINER:/usr/src/arvados/sdk/cwl
 
 arvbox pipe <<EOF
 set -eu -o pipefail
 
 . /usr/local/lib/arvbox/common.sh
 
-export PYCMD=$pythoncmd
-
 if test $config = dev -o $reinstall = 1; then
-  cd /usr/src/arvados/sdk/python
-  \$PYCMD setup.py sdist
-  pip_install \$(ls -r dist/arvados-python-client-*.tar.gz | head -n1)
-
-  cd /usr/src/arvados/sdk/cwl
-  \$PYCMD setup.py sdist
-  pip_install \$(ls -r dist/arvados-cwl-runner-*.tar.gz | head -n1)
+  pip_install_sdist sdk/python sdk/cwl
 fi
 
 set -x
@@ -117,11 +110,7 @@ set -x
 # our files are in Keep, all the tests fail.
 # We should add [optional] Arvados support to cwltest so it can access
 # Keep but for the time being just install the last working version.
-if [ "\$PYCMD" = "python3" ]; then
-    pip3 install 'cwltest<2.3.20230527113600'
-else
-    pip install 'cwltest<2.3.20230527113600'
-fi
+/opt/arvados-py/bin/pip install 'cwltest<2.3.20230527113600'
 
 mkdir -p /tmp/cwltest
 cd /tmp/cwltest
@@ -148,7 +137,7 @@ if [[ "$suite" = "conformance-v1.1" ]] ; then
 fi
 
 if [[ "$suite" = "conformance-v1.2" ]] ; then
-   git checkout 1.2.1_proposed
+   git checkout v1.2.1
 fi
 
 #if [[ "$suite" != "integration" ]] ; then
@@ -183,24 +172,23 @@ cwltest --version
 # Skip test 199 in the v1.1 suite because it has different output
 # depending on whether there is a pty associated with stdout (fixed in
 # the v1.2 suite)
-#
-# Skip test 307 in the v1.2 suite because the test relied on
-# secondary file behavior of cwltool that wasn't actually correct to specification
 
 if [[ "$suite" = "integration" ]] ; then
    cd /usr/src/arvados/sdk/cwl/tests
    exec ./arvados-tests.sh $@
 elif [[ "$suite" = "conformance-v1.2" ]] ; then
-   exec cwltest --tool arvados-cwl-runner --test conformance_tests.yaml -Sdocker_entrypoint,timelimit_invalid_wf -N307 $@ -- \$EXTRA
+   exec cwltest --tool arvados-cwl-runner --test conformance_tests.yaml -Sdocker_entrypoint --badgedir /tmp/badges $@ -- \$EXTRA
 elif [[ "$suite" = "conformance-v1.1" ]] ; then
-   exec cwltest --tool arvados-cwl-runner --test conformance_tests.yaml -Sdocker_entrypoint,timelimit_invalid_wf -N199 $@ -- \$EXTRA
+   exec cwltest --tool arvados-cwl-runner --test conformance_tests.yaml -Sdocker_entrypoint,timelimit_invalid_wf -N199 --badgedir /tmp/badges $@ -- \$EXTRA
 elif [[ "$suite" = "conformance-v1.0" ]] ; then
-   exec cwltest --tool arvados-cwl-runner --test v1.0/conformance_test_v1.0.yaml -Sdocker_entrypoint $@ -- \$EXTRA
+   exec cwltest --tool arvados-cwl-runner --test v1.0/conformance_test_v1.0.yaml -Sdocker_entrypoint --badgedir /tmp/badges $@ -- \$EXTRA
 fi
 EOF
 
 CODE=$?
 
+docker cp -L $ARVBOX_CONTAINER:/tmp/badges $cwldir/badges
+
 if test $leave_running = 0 ; then
     arvbox stop
 fi