From: Toshi MARUYAMA Date: Fri, 4 Jul 2014 02:23:16 +0000 (+0000) Subject: Merge .travis.yml related revisions from trunk to 2.4-stable X-Git-Tag: 2.4.6~4 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=87c93a3c8505a24275f8b28d89061f8ee560a496;p=redmine.git Merge .travis.yml related revisions from trunk to 2.4-stable git-svn-id: http://svn.redmine.org/redmine/branches/2.4-stable@13212 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 000000000..8cb59f1b2 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,37 @@ +# Redmine runs tests on own continuous integration server. +# http://www.redmine.org/projects/redmine/wiki/Continuous_integration +# You can also run tests on your environment. +language: ruby +rvm: + - 1.8.7 + - 1.9.3 + - 2.0 + - jruby +matrix: + allow_failures: + # SCM tests fail randomly due to IO.popen(). + # https://github.com/jruby/jruby/issues/779 + - rvm: jruby +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" +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" + - "git --version" + - "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 d30e9fb0a..41a334c5e 100644 --- a/lib/tasks/ci.rake +++ b/lib/tasks/ci.rake @@ -1,4 +1,4 @@ -desc "Run the Continous Integration tests for Redmine" +desc "Run the Continuous Integration tests for Redmine" task :ci do # RAILS_ENV and ENV[] can diverge so force them both to test ENV['RAILS_ENV'] = 'test' @@ -16,13 +16,23 @@ namespace :ci do Rake::Task["db:create:all"].invoke Rake::Task["db:migrate"].invoke Rake::Task["db:schema:dump"].invoke - Rake::Task["test:scm:setup:all"].invoke + if scms = ENV['SCMS'] + scms.split(',').each do |scm| + Rake::Task["test:scm:setup:#{scm}"].invoke + end + else + Rake::Task["test:scm:setup:all"].invoke + end Rake::Task["test:scm:update"].invoke end desc "Build Redmine" task :build do - Rake::Task["test"].invoke + if test_suite = ENV['TEST_SUITE'] + Rake::Task["test:#{test_suite}"].invoke + else + Rake::Task["test"].invoke + end # Rake::Task["test:ui"].invoke if RUBY_VERSION >= '1.9.3' end @@ -43,14 +53,24 @@ file 'config/database.yml' do case database when 'mysql' dev_conf = {'adapter' => (RUBY_VERSION >= '1.9' ? 'mysql2' : 'mysql'), - 'database' => dev_db_name, 'host' => 'localhost', - 'username' => 'jenkins', 'password' => 'jenkins', - 'encoding' => 'utf8'} + 'database' => dev_db_name, 'host' => 'localhost', + '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) ?