[ARVADOS-DEV] created: 60d3fdf6dedff3cb9eca478caacfeee19a752812

git at public.curoverse.com git at public.curoverse.com
Wed Jan 13 14:50:51 EST 2016


        at  60d3fdf6dedff3cb9eca478caacfeee19a752812 (commit)


commit 60d3fdf6dedff3cb9eca478caacfeee19a752812
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Wed Jan 13 14:50:45 2016 -0500

    8080: Successfully tests all packages.  Produces before/after/diff lists for each package.

diff --git a/jenkins/run-build-packages-one-target.sh b/jenkins/run-build-packages-one-target.sh
index afb6eff..2399342 100755
--- a/jenkins/run-build-packages-one-target.sh
+++ b/jenkins/run-build-packages-one-target.sh
@@ -14,6 +14,8 @@ Syntax:
     Run package install test script "test-packages-$target.sh"
 --debug
     Output debug information (default: false)
+--only-test
+    Test only a specific package
 
 WORKSPACE=path         Path to the Arvados source tree to build packages from
 
@@ -36,7 +38,7 @@ if ! [[ -d "$WORKSPACE" ]]; then
 fi
 
 PARSEDOPTS=$(getopt --name "$0" --longoptions \
-    help,debug,test-packages,target:,command: \
+    help,debug,test-packages,target:,command:,only-test: \
     -- "" "$@")
 if [ $? -ne 0 ]; then
     exit 1
@@ -57,6 +59,9 @@ while [ $# -gt 0 ]; do
         --target)
             TARGET="$2"; shift
             ;;
+        --only-test)
+            packages="$2"; shift
+            ;;
         --debug)
             DEBUG=" --debug"
             ;;
@@ -111,6 +116,7 @@ cd $TARGET
 time docker build --tag=$IMAGE .
 popd
 
+if test -z "$packages" ; then
 packages="arvados-api-server
         arvados-data-manager
         arvados-docker-cleaner
@@ -126,14 +132,18 @@ packages="arvados-api-server
         libarvados-perl
         python27-python-arvados-fuse
         python27-python-arvados-python-client"
+fi
 
 FINAL_EXITCODE=0
 
+package_fails=""
+
 if [[ -n "$test_packages" ]]; then
     for p in $packages ; do
         if ! docker run --rm -v "$JENKINS_DIR:/jenkins" -v "$WORKSPACE:/arvados" \
                   --env ARVADOS_DEBUG=1 "$IMAGE" $COMMAND $p ; then
             FINAL_EXITCODE=$?
+            package_fails="$package_fails $p"
             echo "ERROR: $tag build failed with exit status $FINAL_EXITCODE." >&2
         fi
     done
@@ -148,4 +158,8 @@ else
     fi
 fi
 
+if test -n "$package_fails" ; then
+    echo "Failed package tests:$package_fails"
+fi
+
 exit $FINAL_EXITCODE
diff --git a/jenkins/test-packages-centos6.sh b/jenkins/test-packages-centos6.sh
index 3d084ab..9241291 100755
--- a/jenkins/test-packages-centos6.sh
+++ b/jenkins/test-packages-centos6.sh
@@ -5,8 +5,16 @@ set -eu
 yum -q clean all
 touch /var/lib/rpm/*
 
+rpm -qa | sort > /arvados/packages/centos6/$1.before
+
 yum install --assumeyes $1
 
+rpm -qa | sort > /arvados/packages/centos6/$1.after
+
+set +e
+diff /arvados/packages/centos6/$1.before /arvados/packages/centos6/$1.after > /arvados/packages/centos6/$1.diff
+set -e
+
 SCL=""
 if scl enable python27 true 2>/dev/null ; then
     SCL="scl enable python27"
@@ -15,7 +23,7 @@ fi
 mkdir -p /tmp/opts
 cd /tmp/opts
 
-rpm2cpio /arvados/packages/centos6/$1-*.rpm | cpio -idm
+rpm2cpio /arvados/packages/centos6/$1-*.rpm | cpio -idm 2>/dev/null
 
 shared=$(find -name '*.so')
 if test -n "$shared" ; then
@@ -27,4 +35,8 @@ if test -n "$shared" ; then
     done
 fi
 
-exec $SCL /jenkins/common-test-packages.sh $1
+if test -n "$SCL" ; then
+    exec $SCL "/jenkins/common-test-packages.sh $1"
+else
+    exec /jenkins/common-test-packages.sh $1
+fi

commit ffd741be7af1eca4c11884a3e8aa6630be25de2d
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Wed Jan 13 14:11:30 2016 -0500

    8008: Test each Arvados package individually.

diff --git a/jenkins/common-test-packages.sh b/jenkins/common-test-packages.sh
index c9d77c8..1ff8707 100755
--- a/jenkins/common-test-packages.sh
+++ b/jenkins/common-test-packages.sh
@@ -1,28 +1,28 @@
 #!/bin/sh
 
+set -eu
+
 FAIL=0
 
 echo
-for so in $(find . -name "*.so") ; do
-    if ldd $so | grep "not found" ; then
-        echo "^^^ Missing while scanning $so ^^^"
-        FAIL=1
-    fi
-done
+shared=$(find -name '*.so')
+if test -n "$shared" ; then
+    for so in $shared ; do
+        if ldd $so | grep "not found" ; then
+            echo "^^^ Missing while scanning $so ^^^"
+            FAIL=1
+        fi
+    done
+fi
 
-echo
-if ! python <<EOF
-import arvados
-import arvados_fuse
-print "Successly imported arvados and arvados_fuse"
+if test -x /jenkins/test-package-$1.sh ; then
+    if ! /jenkins/test-package-$1.sh ; then
+       FAIL=1
+    fi
+fi
 
-import libcloud.compute.types
-import libcloud.compute.providers
-libcloud.compute.providers.get_driver(libcloud.compute.types.Provider.AZURE_ARM)
-print "Successly imported compatible libcloud library"
-EOF
-then
-    FAIL=1
+if test $FAIL = 0 ; then
+   echo "Package $1 passed"
 fi
 
 exit $FAIL
diff --git a/jenkins/deb-common-test-packages.sh b/jenkins/deb-common-test-packages.sh
index 4bc4573..fe6a04e 100755
--- a/jenkins/deb-common-test-packages.sh
+++ b/jenkins/deb-common-test-packages.sh
@@ -1,22 +1,18 @@
 #!/bin/bash
 
+set -eu
+
 # Multiple .deb based distros symlink to this script, so extract the target
 # from the invocation path.
 target=$(echo $0 | sed 's/.*test-packages-\([^.]*\)\.sh.*/\1/')
 
 apt-get -qq update
-if ! apt-get --assume-yes --force-yes install \
-     python-arvados-python-client python-arvados-fuse arvados-node-manager
-then
-    exit 1
-fi
+apt-get --assume-yes --force-yes install $1
 
 mkdir -p /tmp/opts
 cd /tmp/opts
 
-for r in /arvados/packages/$target/python-*amd64.deb ; do
-    dpkg-deb -x $r .
-done
+dpkg-deb -x /arvados/packages/$target/$1-*.deb .
 
 for so in $(find . -name "*.so") ; do
     echo
@@ -24,4 +20,4 @@ for so in $(find . -name "*.so") ; do
     ldd $so | awk '($3 ~ /^\//){print $3}' | sort -u | xargs dpkg -S | cut -d: -f1 | sort -u
 done
 
-exec /jenkins/common-test-packages.sh
+exec /jenkins/common-test-packages.sh $1
diff --git a/jenkins/run-build-packages-one-target.sh b/jenkins/run-build-packages-one-target.sh
index 1d4249b..afb6eff 100755
--- a/jenkins/run-build-packages-one-target.sh
+++ b/jenkins/run-build-packages-one-target.sh
@@ -111,15 +111,41 @@ cd $TARGET
 time docker build --tag=$IMAGE .
 popd
 
+packages="arvados-api-server
+        arvados-data-manager
+        arvados-docker-cleaner
+        arvados-git-httpd
+        arvados-node-manager
+        arvados-src
+        arvados-workbench
+        crunchstat
+        keepproxy
+        keep-rsync
+        keepstore
+        keep-web
+        libarvados-perl
+        python27-python-arvados-fuse
+        python27-python-arvados-python-client"
+
 FINAL_EXITCODE=0
 
-if docker run --rm -v "$JENKINS_DIR:/jenkins" -v "$WORKSPACE:/arvados" \
-          --env ARVADOS_DEBUG=1 "$IMAGE" $COMMAND; then
-    # Success - nothing more to do.
-    true
+if [[ -n "$test_packages" ]]; then
+    for p in $packages ; do
+        if ! docker run --rm -v "$JENKINS_DIR:/jenkins" -v "$WORKSPACE:/arvados" \
+                  --env ARVADOS_DEBUG=1 "$IMAGE" $COMMAND $p ; then
+            FINAL_EXITCODE=$?
+            echo "ERROR: $tag build failed with exit status $FINAL_EXITCODE." >&2
+        fi
+    done
 else
-    FINAL_EXITCODE=$?
-    echo "ERROR: $tag build failed with exit status $FINAL_EXITCODE." >&2
+    if docker run --rm -v "$JENKINS_DIR:/jenkins" -v "$WORKSPACE:/arvados" \
+              --env ARVADOS_DEBUG=1 "$IMAGE" $COMMAND; then
+        # Success - nothing more to do.
+        true
+    else
+        FINAL_EXITCODE=$?
+        echo "ERROR: $tag build failed with exit status $FINAL_EXITCODE." >&2
+    fi
 fi
 
 exit $FINAL_EXITCODE
diff --git a/jenkins/test-package-arvados-node-manager.sh b/jenkins/test-package-arvados-node-manager.sh
new file mode 100755
index 0000000..c6760f8
--- /dev/null
+++ b/jenkins/test-package-arvados-node-manager.sh
@@ -0,0 +1,7 @@
+#!/bin/sh
+exec python <<EOF
+import libcloud.compute.types
+import libcloud.compute.providers
+libcloud.compute.providers.get_driver(libcloud.compute.types.Provider.AZURE_ARM)
+print "Successly imported compatible libcloud library"
+EOF
diff --git a/jenkins/test-package-python27-python-arvados-fuse.sh b/jenkins/test-package-python27-python-arvados-fuse.sh
new file mode 100755
index 0000000..d2a1072
--- /dev/null
+++ b/jenkins/test-package-python27-python-arvados-fuse.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+exec python <<EOF
+import arvados_fuse
+print "Successly imported arvados_fuse"
+EOF
diff --git a/jenkins/test-package-python27-python-arvados-python-client.sh b/jenkins/test-package-python27-python-arvados-python-client.sh
new file mode 100755
index 0000000..c5abddd
--- /dev/null
+++ b/jenkins/test-package-python27-python-arvados-python-client.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+exec python <<EOF
+import arvados
+print "Successly imported arvados"
+EOF
diff --git a/jenkins/test-packages-centos6.sh b/jenkins/test-packages-centos6.sh
index 0d956af..3d084ab 100755
--- a/jenkins/test-packages-centos6.sh
+++ b/jenkins/test-packages-centos6.sh
@@ -1,25 +1,30 @@
 #!/bin/bash
 
+set -eu
+
 yum -q clean all
 touch /var/lib/rpm/*
-if ! yum install --assumeyes \
-     python27-python-arvados-python-client python27-python-arvados-fuse arvados-node-manager
-then
-    exit 1
+
+yum install --assumeyes $1
+
+SCL=""
+if scl enable python27 true 2>/dev/null ; then
+    SCL="scl enable python27"
 fi
 
 mkdir -p /tmp/opts
 cd /tmp/opts
 
-for r in /arvados/packages/centos6/python27-python-*x86_64.rpm ; do
-    rpm2cpio $r | cpio -idm
-done
+rpm2cpio /arvados/packages/centos6/$1-*.rpm | cpio -idm
 
-for so in $(find -name "*.so") ; do
-    echo
-    echo "== Packages dependencies for $so =="
-    scl enable python27 "ldd $so" \
-        | awk '($3 ~ /^\//){print $3}' | sort -u | xargs rpm -qf | sort -u
-done
+shared=$(find -name '*.so')
+if test -n "$shared" ; then
+    for so in $shared ; do
+        echo
+        echo "== Packages dependencies for $so =="
+        $SCL ldd "$so" \
+            | awk '($3 ~ /^\//){print $3}' | sort -u | xargs rpm -qf | sort -u
+    done
+fi
 
-exec scl enable python27 /jenkins/common-test-packages.sh
+exec $SCL /jenkins/common-test-packages.sh $1

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list