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
EOF
+set -e
+
if ! [[ -n "$WORKSPACE" ]]; then
echo >&2 "$helpmessage"
echo >&2
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
--target)
TARGET="$2"; shift
;;
+ --only-test)
+ packages="$2"; shift
+ ;;
--debug)
DEBUG=" --debug"
;;
if [[ -n "$(find $WORKSPACE/packages/$TARGET -name *.deb)" ]] ; then
(cd $WORKSPACE/packages/$TARGET
- dpkg-scanpackages . /dev/null | gzip -c > Packages.gz
+ dpkg-scanpackages . 2> >(grep -v 'warning' 1>&2) | gzip -c > Packages.gz
)
fi
- COMMAND="/jenkins/test-packages-$TARGET.sh"
+ COMMAND="/jenkins/package-testing/test-packages-$TARGET.sh"
IMAGE="arvados/package-test:$TARGET"
else
IMAGE="arvados/build:$TARGET"
if [[ -n "$test_packages" ]]; then
pushd "$JENKINS_DIR/package-test-dockerfiles"
else
- pushd "$JENKINS_DIR/dockerfiles"
+ pushd "$JENKINS_DIR/package-build-dockerfiles"
+ make "$TARGET/generated"
fi
echo $TARGET
time docker build --tag=$IMAGE .
popd
+if test -z "$packages" ; then
+ 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"
+
+ case "$TARGET" in
+ centos6)
+ packages="$packages python27-python-arvados-fuse
+ python27-python-arvados-python-client"
+ ;;
+ *)
+ packages="$packages python-arvados-fuse
+ python-arvados-python-client"
+ ;;
+ esac
+fi
+
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
+package_fails=""
+
+mkdir -p "$WORKSPACE/apps/workbench/vendor/cache-$TARGET"
+mkdir -p "$WORKSPACE/services/api/vendor/cache-$TARGET"
+
+docker_volume_args=(
+ -v "$JENKINS_DIR:/jenkins"
+ -v "$WORKSPACE:/arvados"
+ -v /arvados/services/api/vendor/bundle
+ -v /arvados/apps/workbench/vendor/bundle
+ -v "$WORKSPACE/services/api/vendor/cache-$TARGET:/arvados/services/api/vendor/cache"
+ -v "$WORKSPACE/apps/workbench/vendor/cache-$TARGET:/arvados/apps/workbench/vendor/cache"
+)
+
+if [[ -n "$test_packages" ]]; then
+ for p in $packages ; do
+ echo
+ echo "START: $p test on $IMAGE" >&2
+ if docker run --rm \
+ "${docker_volume_args[@]}" \
+ --env ARVADOS_DEBUG=1 \
+ --env "TARGET=$TARGET" \
+ --env "WORKSPACE=/arvados" \
+ "$IMAGE" $COMMAND $p
+ then
+ echo "OK: $p test on $IMAGE succeeded" >&2
+ else
+ FINAL_EXITCODE=$?
+ package_fails="$package_fails $p"
+ echo "ERROR: $p test on $IMAGE failed with exit status $FINAL_EXITCODE" >&2
+ fi
+ done
else
- FINAL_EXITCODE=$?
- echo "ERROR: $tag build failed with exit status $FINAL_EXITCODE." >&2
+ echo
+ echo "START: build packages on $IMAGE" >&2
+ if docker run --rm \
+ "${docker_volume_args[@]}" \
+ --env ARVADOS_DEBUG=1 \
+ "$IMAGE" $COMMAND
+ then
+ echo
+ echo "OK: build packages on $IMAGE succeeded" >&2
+ else
+ FINAL_EXITCODE=$?
+ echo "ERROR: build packages on $IMAGE failed with exit status $FINAL_EXITCODE" >&2
+ fi
+fi
+
+if test -n "$package_fails" ; then
+ echo "Failed package tests:$package_fails" >&2
fi
exit $FINAL_EXITCODE