8080: Successfully tests all packages. Produces before/after/diff lists for each...
authorPeter Amstutz <peter.amstutz@curoverse.com>
Wed, 13 Jan 2016 19:50:45 +0000 (14:50 -0500)
committerPeter Amstutz <peter.amstutz@curoverse.com>
Wed, 13 Jan 2016 19:50:45 +0000 (14:50 -0500)
jenkins/run-build-packages-one-target.sh
jenkins/test-packages-centos6.sh

index afb6effa9e5204391da9e7f7cc34c42899c2d227..23993426c43c0bbcd15174cb6420b38d4eca74a1 100755 (executable)
@@ -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
index 3d084ab8ec60bdef709f07759956a0c6992f65fb..9241291ce7025e7c48de4859d485bc4e0ee9f839 100755 (executable)
@@ -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