From 653f70569c844ce64393bea85078550720bc7f6e Mon Sep 17 00:00:00 2001 From: Praveen Arimbrathodiyil Date: Wed, 30 Nov 2016 14:38:34 +0530 Subject: [PATCH] run tests in test mode --- debian/conf/database.yml | 5 +++-- debian/conf/gitlab.yml.example | 7 ++++--- debian/tests/spec | 9 +++++++++ 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/debian/conf/database.yml b/debian/conf/database.yml index d8caddaa19..c2e2b8e670 100644 --- a/debian/conf/database.yml +++ b/debian/conf/database.yml @@ -40,7 +40,8 @@ staging: test: &test adapter: postgresql encoding: unicode - database: gitlabhq_test + host: /var/run/postgresql + database: gitlab_test pool: 5 - username: postgres + #username: postgres password: diff --git a/debian/conf/gitlab.yml.example b/debian/conf/gitlab.yml.example index 9f05d24dd0..daa3f2a259 100644 --- a/debian/conf/gitlab.yml.example +++ b/debian/conf/gitlab.yml.example @@ -399,15 +399,16 @@ test: # When you run tests we clone and setup gitlab-shell # In order to setup it correctly you need to specify # your system username you use to run GitLab - # user: YOUR_USERNAME + user: gitlab satellites: path: tmp/tests/gitlab-satellites/ backup: path: tmp/tests/backups gitlab_shell: - path: tmp/tests/gitlab-shell/ + path: /usr/share/gitlab-shell/ 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: redmine: title: "Redmine" diff --git a/debian/tests/spec b/debian/tests/spec index 879716348b..a4c25cbbf6 100755 --- a/debian/tests/spec +++ b/debian/tests/spec @@ -21,5 +21,14 @@ su gitlab -c 'truncate -s 0 Gemfile.lock' export $(cat /etc/gitlab/gitlab-debian.conf) export INCLUDE_TEST_DEPENDS="true" 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" #config 2/2 failed, controllers many failed