debian-mirror-gitlab/debian/tests/spec

38 lines
955 B
Bash
Executable file

#!/bin/sh
export SOURCE_TREE=${PWD}
if [ -z "$ADTTMP" ]; then
ADTTMP=$(mktemp -d)
cleanup() {
rm -rf "$ADTTMP"
}
trap cleanup INT TERM EXIT
fi
cd $ADTTMP
exec 2>&1
set -ex
cd /usr/share/gitlab
su gitlab -c 'truncate -s 0 Gemfile.lock'
. /etc/gitlab/gitlab-debian.conf
export RAILS_ENV=test
export DB=postgres
export INCLUDE_TEST_DEPENDS="true"
echo "Installing test only dependencies from rubygems.org..."
cp ${SOURCE_TREE}/debian/Gemfile.autopkgtest .
BUNDLE_GEMFILE=Gemfile.autopkgtest bundle install
su gitlab -c "bundle install --local"
su gitlab -c "mkdir -p tmp/tests/gitlab-shell"
export dbname=gitlab_test
su postgres -c "createdb $dbname"
# enable the pg_trgm extension
su postgres -c "psql -d $dbname -c \"CREATE EXTENSION IF NOT EXISTS pg_trgm;\"" || {
exit 1
}
su gitlab -c "bundle exec rake db:migrate"
su gitlab -c "bundle exec rake -f ${SOURCE_TREE}/debian/tests/spec.rake"
#config 2/2 failed, controllers many failed