21128: Merge commit 'adbbc9e3c7a36d39b30f403555ee5889e32adcc0' into 21128-toolbar...
[arvados.git] / sdk / cwl / test_with_arvbox.sh
index 0a64fe97a9b67f0ede9382aa389749bf20b06c8b..55099afdf766c33cad9a6fee3503fc7173524491 100755 (executable)
@@ -17,6 +17,7 @@ tag="latest"
 pythoncmd=python3
 suite=conformance
 runapi=containers
+reinstall=0
 
 while test -n "$1" ; do
     arg="$1"
@@ -45,6 +46,10 @@ while test -n "$1" ; do
             devcwl=1
             shift
             ;;
+        --reinstall)
+            reinstall=1
+            shift
+            ;;
         --pythoncmd)
             pythoncmd=$2
             shift ; shift
@@ -83,6 +88,10 @@ fi
 
 arvbox start $config $tag
 
+# Copy the integration test suite from our local arvados clone instead
+# 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
 
 arvbox pipe <<EOF
@@ -92,7 +101,11 @@ set -eu -o pipefail
 
 export PYCMD=$pythoncmd
 
-if test $config = dev ; then
+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)
@@ -100,10 +113,14 @@ fi
 
 set -x
 
+# 2.3.20230527113600 release of cwltest confirms that files exist on disk, since
+# 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
+    pip3 install 'cwltest<2.3.20230527113600'
 else
-    pip install cwltest
+    pip install 'cwltest<2.3.20230527113600'
 fi
 
 mkdir -p /tmp/cwltest
@@ -126,6 +143,14 @@ elif [[ "$suite" != "integration" ]] ; then
    exit 1
 fi
 
+if [[ "$suite" = "conformance-v1.1" ]] ; then
+   git checkout main
+fi
+
+if [[ "$suite" = "conformance-v1.2" ]] ; then
+   git checkout 1.2.1_proposed
+fi
+
 #if [[ "$suite" != "integration" ]] ; then
 #  git pull
 #fi
@@ -145,6 +170,23 @@ if [[ $devcwl -eq 1 ]] ; then
 fi
 
 env
+
+arvados-cwl-runner --version
+cwltest --version
+
+# Skip docker_entrypoint test because it fails on singularity
+#
+# Skip timelimit_invalid_wf test because the timeout is very short
+# (5s) and singularity containers loading off an arv-mount take too long
+# to start and get incorrectly terminated
+#
+# 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 $@