Continous integration update

This commit is contained in:
Karel Pičman 2018-06-15 15:33:59 +02:00
parent 4c55858136
commit 0f45c67d08
6 changed files with 36 additions and 25 deletions

View File

@ -33,17 +33,22 @@ script:
- export PATH_TO_DMSF=`pwd`
- export PATH_TO_REDMINE=$WORKSPACE/redmine
- mkdir -p ${WORKSPACE}
- cp -f config/database.yml.travis ${WORKSPACE}/database.yml
- cp -f ./test/ci/${DB}.yml ${WORKSPACE}/database.yml
- bash -x ./test/ci/redmine_install.sh -c
- bash -x ./test/ci/redmine_install.sh -i
- bash -x ./test/ci/redmine_install.sh -t
- bash -x ./test/ci/redmine_install.sh -u
env:
- RAILS_ENV=test
- NAME=redmine_dmsf
- DB=sqlite
- DB=mysql
- DB=postgres
cache: bundler
gemfile:
- ${PATH_TO_REDMINE}/Gemfile
- ${PATH_TO_REDMINE}/Gemfile
services:
- mysql
- postgresql

View File

@ -1,7 +0,0 @@
development:
adapter: sqlite3
database: db/redmine_development.sqlite3
test:
adapter: sqlite3
database: db/redmine_development.sqlite3

7
test/ci/mysql.yml Normal file
View File

@ -0,0 +1,7 @@
test:
adapter: mysql2
database: test
username: root
encoding: utf8mb4
collation: utf8mb4_unicode_ci

5
test/ci/postgres.yml Normal file
View File

@ -0,0 +1,5 @@
test:
adapter: postgres
database: test
encoding: utf8

View File

@ -39,14 +39,10 @@ test()
cd $PATH_TO_REDMINE
# create tmp/cache folder (required for Rails 3)
# https://github.com/rails/rails/issues/5376
#bundle exec rake tmp:create
# Run tests within application
bundle exec rake redmine:plugins:test:units
bundle exec rake redmine:plugins:test:functionals
bundle exec rake redmine:plugins:test:integration
bundle exec rake redmine:plugins:test:units NAME=redmine_dmsf RAILS_ENV=test
bundle exec rake redmine:plugins:test:functionals NAME=redmine_dmsf RAILS_ENV=test
bundle exec rake redmine:plugins:test:integration NAME=redmine_dmsf RAILS_ENV=test
}
uninstall()
@ -57,7 +53,7 @@ uninstall()
cd $PATH_TO_REDMINE
# clean up database
bundle exec rake redmine:plugins:migrate VERSION=0
bundle exec rake redmine:plugins:migrate NAME=redmine_dmsf VERSION=0 RAILS_ENV=test
}
install()
@ -71,25 +67,25 @@ install()
# Create a link to the dmsf plugin
ln -sf $PATH_TO_DMSF plugins/redmine_dmsf
# Copy database.yml
cp $WORKSPACE/database.yml config/
# Install gems
# Not ideal, but at present Travis-CI will not install with xapian enabled:
bundle install --without xapian rmagick development
bundle install --without xapian rmagick development RAILS_ENV=test
# Run Redmine database migrations
bundle exec rake db:migrate --trace
bundle exec rake db:migrate --trace RAILS_ENV=test
# Load Redmine database default data
bundle exec rake redmine:load_default_data REDMINE_LANG=en
bundle exec rake redmine:load_default_data REDMINE_LANG=en RAILS_ENV=test
# generate session store/secret token
bundle exec rake generate_secret_token
bundle exec rake generate_secret_token RAILS_ENV=test
# Run the plugin database migrations
bundle exec rake redmine:plugins:migrate
bundle exec rake redmine:plugins:migrate RAILS_ENV=test
}
while getopts :ictu opt

5
test/ci/sqlite.yml Normal file
View File

@ -0,0 +1,5 @@
test:
adapter: sqlite3
database: ":memory:"
timeout: 500