From 1951aeac78974d38ffa5528feb4b97ef6d458377 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Sat, 18 Jan 2014 23:59:32 +0000 Subject: [PATCH] add .travis.yml and switch database user/password by environments git-svn-id: http://svn.redmine.org/redmine/trunk@12665 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- .travis.yml | 41 +++++++++++++++++++++++++++++++++++++++++ lib/tasks/ci.rake | 16 +++++++++++++--- 2 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..96fcb2e6e --- /dev/null +++ b/.travis.yml @@ -0,0 +1,41 @@ +# Redmine runs tests on own continuous integration server. +# http://www.redmine.org/projects/redmine/wiki/Continuous_integration +# You can also run on tests on your environment. +language: ruby +rvm: + - 1.8.7 + - 1.9.3 + - 2.0.0 + - 2.1.0 + - jruby-18mode + - jruby-19mode +env: + - "TEST_SUITE=units DATABASE_ADAPTER=postgresql" + - "TEST_SUITE=functionals DATABASE_ADAPTER=postgresql" + - "TEST_SUITE=integration DATABASE_ADAPTER=postgresql" + - "TEST_SUITE=units DATABASE_ADAPTER=mysql" + - "TEST_SUITE=functionals DATABASE_ADAPTER=mysql" + - "TEST_SUITE=integration DATABASE_ADAPTER=mysql" + - "TEST_SUITE=units DATABASE_ADAPTER=sqlite3" + - "TEST_SUITE=functionals DATABASE_ADAPTER=sqlite3" + - "TEST_SUITE=integration DATABASE_ADAPTER=sqlite3" +matrix: + allow_failures: + - rvm: jruby-19mode + env: "TEST_SUITE=units DATABASE_ADAPTER=postgresql" + - rvm: jruby-19mode + env: "TEST_SUITE=functionals DATABASE_ADAPTER=postgresql" + - rvm: jruby-19mode + env: "TEST_SUITE=integration DATABASE_ADAPTER=postgresql" +before_install: + - "sudo apt-get update -qq" + - "sudo apt-get --no-install-recommends install bzr cvs git mercurial subversion" +script: + - "SCMS=bazaar,cvs,subversion,git,mercurial,filesystem" + - "export SCMS" + - "bundle install" + - "RUN_ON_NOT_OFFICIAL='' RUBY_VER=1.9 BRANCH=trunk bundle exec rake config/database.yml" + - "bundle install" + - "JRUBY_OPTS=-J-Xmx1024m bundle exec rake ci" +notifications: + email: false diff --git a/lib/tasks/ci.rake b/lib/tasks/ci.rake index 945836162..fbc4d5688 100644 --- a/lib/tasks/ci.rake +++ b/lib/tasks/ci.rake @@ -54,13 +54,23 @@ file 'config/database.yml' do when 'mysql' dev_conf = {'adapter' => (RUBY_VERSION >= '1.9' ? 'mysql2' : 'mysql'), 'database' => dev_db_name, 'host' => 'localhost', - 'username' => 'jenkins', 'password' => 'jenkins', 'encoding' => 'utf8'} + if ENV['RUN_ON_NOT_OFFICIAL'] + dev_conf['username'] = 'root' + else + dev_conf['username'] = 'jenkins' + dev_conf['password'] = 'jenkins' + end test_conf = dev_conf.merge('database' => test_db_name) when 'postgresql' dev_conf = {'adapter' => 'postgresql', 'database' => dev_db_name, - 'host' => 'localhost', - 'username' => 'jenkins', 'password' => 'jenkins'} + 'host' => 'localhost'} + if ENV['RUN_ON_NOT_OFFICIAL'] + dev_conf['username'] = 'postgres' + else + dev_conf['username'] = 'jenkins' + dev_conf['password'] = 'jenkins' + end test_conf = dev_conf.merge('database' => test_db_name) when /sqlite3/ dev_conf = {'adapter' => (Object.const_defined?(:JRUBY_VERSION) ? -- 2.39.5