run tests in test mode

This commit is contained in:
Praveen Arimbrathodiyil 2016-11-30 14:38:34 +05:30
parent 75ded92652
commit 653f70569c
3 changed files with 16 additions and 5 deletions

View file

@ -40,7 +40,8 @@ staging:
test: &test test: &test
adapter: postgresql adapter: postgresql
encoding: unicode encoding: unicode
database: gitlabhq_test host: /var/run/postgresql
database: gitlab_test
pool: 5 pool: 5
username: postgres #username: postgres
password: password:

View file

@ -399,15 +399,16 @@ test:
# When you run tests we clone and setup gitlab-shell # When you run tests we clone and setup gitlab-shell
# In order to setup it correctly you need to specify # In order to setup it correctly you need to specify
# your system username you use to run GitLab # your system username you use to run GitLab
# user: YOUR_USERNAME user: gitlab
satellites: satellites:
path: tmp/tests/gitlab-satellites/ path: tmp/tests/gitlab-satellites/
backup: backup:
path: tmp/tests/backups path: tmp/tests/backups
gitlab_shell: gitlab_shell:
path: tmp/tests/gitlab-shell/ path: /usr/share/gitlab-shell/
repos_path: tmp/tests/repositories/ repos_path: tmp/tests/repositories/
hooks_path: tmp/tests/gitlab-shell/hooks/ hooks_path: /usr/share/gitlab-shell/hooks/
secret_file: tmp/tests/gitlab-shell/.gitlab_shell_secret
issues_tracker: issues_tracker:
redmine: redmine:
title: "Redmine" title: "Redmine"

9
debian/tests/spec vendored
View file

@ -21,5 +21,14 @@ su gitlab -c 'truncate -s 0 Gemfile.lock'
export $(cat /etc/gitlab/gitlab-debian.conf) export $(cat /etc/gitlab/gitlab-debian.conf)
export INCLUDE_TEST_DEPENDS="true" export INCLUDE_TEST_DEPENDS="true"
su gitlab -c "bundle install --local" su gitlab -c "bundle install --local"
su gitlab -c "mkdir -p tmp/tests/gitlab-shell"
export RAILS_ENV=test
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" su gitlab -c "bundle exec rake -f ${SOURCE_TREE}/debian/tests/spec.rake"
#config 2/2 failed, controllers many failed #config 2/2 failed, controllers many failed