##// END OF EJS Templates
Merged r14416 and r14530 from trunk to 2.6-stable...
Toshi MARUYAMA -
r14150:fb49c28d1cab
parent child
Show More
@@ -1,51 +1,91
1 # Redmine runs tests on own continuous integration server.
1 # Redmine runs tests on own continuous integration server.
2 # http://www.redmine.org/projects/redmine/wiki/Continuous_integration
2 # http://www.redmine.org/projects/redmine/wiki/Continuous_integration
3 # You can also run tests on your environment.
3 # You can also run tests on your environment.
4 language: ruby
4 language: ruby
5 rvm:
5 rvm:
6 - 1.8.7
6 - 1.8.7
7 - 1.9.2
7 - 1.9.2
8 - 1.9.3
8 - 1.9.3
9 - 2.0
9 - 2.0
10 - 2.1
10 - 2.1
11 - 2.2
11 - 2.2
12 - jruby-9.0.0.0
12 - jruby-9.0.0.0
13 - jruby
13 - jruby
14 env:
14 env:
15 - "SUITE=units DB=postgresql"
15 - "SUITE=units DB=postgresql"
16 - "SUITE=functionals DB=postgresql"
16 - "SUITE=functionals DB=postgresql"
17 - "SUITE=integration DB=postgresql"
17 - "SUITE=integration DB=postgresql"
18 - "SUITE=units DB=postgresql-8.4"
19 - "SUITE=functionals DB=postgresql-8.4"
20 - "SUITE=integration DB=postgresql-8.4"
21 - "SUITE=units DB=postgresql-9.1"
22 - "SUITE=functionals DB=postgresql-9.1"
23 - "SUITE=integration DB=postgresql-9.1"
24 - "SUITE=units DB=postgresql-9.2"
25 - "SUITE=functionals DB=postgresql-9.2"
26 - "SUITE=integration DB=postgresql-9.2"
27 - "SUITE=units DB=postgresql-9.3"
28 - "SUITE=functionals DB=postgresql-9.3"
29 - "SUITE=integration DB=postgresql-9.3"
30 - "SUITE=units DB=postgresql-9.4"
31 - "SUITE=functionals DB=postgresql-9.4"
32 - "SUITE=integration DB=postgresql-9.4"
33 - "SUITE=units DB=postgresql-9.5"
34 - "SUITE=functionals DB=postgresql-9.5"
35 - "SUITE=integration DB=postgresql-9.5"
18 - "SUITE=units DB=mysql"
36 - "SUITE=units DB=mysql"
19 - "SUITE=functionals DB=mysql"
37 - "SUITE=functionals DB=mysql"
20 - "SUITE=integration DB=mysql"
38 - "SUITE=integration DB=mysql"
21 - "SUITE=units DB=sqlite3"
39 - "SUITE=units DB=sqlite3"
22 - "SUITE=functionals DB=sqlite3"
40 - "SUITE=functionals DB=sqlite3"
23 - "SUITE=integration DB=sqlite3"
41 - "SUITE=integration DB=sqlite3"
24 matrix:
42 matrix:
25 allow_failures:
43 allow_failures:
26 # SCM tests fail randomly due to IO.popen().
44 # SCM tests fail randomly due to IO.popen().
27 # http://www.redmine.org/issues/19091
45 # http://www.redmine.org/issues/19091
28 # https://github.com/jruby/jruby/issues/779
46 # https://github.com/jruby/jruby/issues/779
29 - rvm: jruby
47 - rvm: jruby
30 before_install:
48 before_install:
31 # https://github.com/travis-ci/travis-ci/issues/4720
49 # https://github.com/travis-ci/travis-ci/issues/4720
32 - if [[ ${TRAVIS_RUBY_VERSION} =~ jruby-9\.0 ]] ;
50 - if [[ ${TRAVIS_RUBY_VERSION} =~ jruby-9\.0 ]] ;
33 then
51 then
34 rvm get master ;
52 rvm get master ;
35 rvm use ${TRAVIS_RUBY_VERSION} --install ;
53 rvm use ${TRAVIS_RUBY_VERSION} --install ;
36 ruby --version ;
54 ruby --version ;
37 fi
55 fi
38 - "sudo apt-get update -qq"
56 - "sudo apt-get update -qq"
39 - "sudo apt-get --no-install-recommends install bzr cvs git mercurial subversion"
57 - "sudo apt-get --no-install-recommends install bzr cvs git mercurial subversion"
58 - if [[ $DB =~ postgresql ]] ;
59 then
60 if [[ $DB =~ postgresql- ]] ;
61 then
62 PG_VER=`echo $DB | sed -e 's/postgresql-//'` ;
63 sudo service postgresql stop ;
64 sudo apt-get -y -qq --purge remove postgresql libpq-dev libpq5 postgresql-client-common postgresql-common ;
65 sudo rm -rf /var/lib/postgresql ;
66 sudo sh -c "echo deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main ${PG_VER} >> /etc/apt/sources.list.d/pgdg.list" ;
67 wget --quiet -O - http://apt.postgresql.org/pub/repos/apt/ACCC4CF8.asc | sudo apt-key add - ;
68 sudo apt-get update -qq ;
69 sudo apt-get -y -o Dpkg::Options::=--force-confdef -o Dpkg::Options::="--force-confnew" install postgresql-${PG_VER} postgresql-contrib-${PG_VER} postgresql-server-dev-${PG_VER} ;
70 echo "local all all trust" | sudo tee /etc/postgresql/${PG_VER}/main/pg_hba.conf ;
71 echo "host all all 127.0.0.1/32 trust" | sudo tee -a /etc/postgresql/${PG_VER}/main/pg_hba.conf ;
72 echo "host all all ::1/128 trust" | sudo tee -a /etc/postgresql/${PG_VER}/main/pg_hba.conf ;
73 sudo service postgresql restart ;
74 fi ;
75 psql --version ;
76 psql -c "SHOW SERVER_VERSION" -U postgres ;
77 psql -c "SHOW SERVER_ENCODING" -U postgres ;
78 psql -c "SHOW DateStyle" -U postgres ;
79 fi
40 script:
80 script:
41 - export DATABASE_ADAPTER=${DB}
81 - export DATABASE_ADAPTER=${DB}
42 - "SCMS=bazaar,cvs,subversion,git,mercurial,filesystem"
82 - "SCMS=bazaar,cvs,subversion,git,mercurial,filesystem"
43 - "export SCMS"
83 - "export SCMS"
44 - "git --version"
84 - "git --version"
45 - "bundle install"
85 - "bundle install"
46 - "RUN_ON_NOT_OFFICIAL='' RUBY_VER=1.9 BRANCH=trunk bundle exec rake config/database.yml"
86 - "RUN_ON_NOT_OFFICIAL='' RUBY_VER=1.9 BRANCH=trunk bundle exec rake config/database.yml"
47 - "bundle install"
87 - "bundle install"
48 - export TEST_SUITE=${SUITE}
88 - export TEST_SUITE=${SUITE}
49 - JRUBY_OPTS='-J-Xmx1024m -J-XX:MaxPermSize=1024m' bundle exec rake ci
89 - JRUBY_OPTS='-J-Xmx1024m -J-XX:MaxPermSize=1024m' bundle exec rake ci
50 notifications:
90 notifications:
51 email: false
91 email: false
@@ -1,92 +1,92
1 desc "Run the Continuous Integration tests for Redmine"
1 desc "Run the Continuous Integration tests for Redmine"
2 task :ci do
2 task :ci do
3 # RAILS_ENV and ENV[] can diverge so force them both to test
3 # RAILS_ENV and ENV[] can diverge so force them both to test
4 ENV['RAILS_ENV'] = 'test'
4 ENV['RAILS_ENV'] = 'test'
5 RAILS_ENV = 'test'
5 RAILS_ENV = 'test'
6 Rake::Task["ci:setup"].invoke
6 Rake::Task["ci:setup"].invoke
7 Rake::Task["ci:build"].invoke
7 Rake::Task["ci:build"].invoke
8 Rake::Task["ci:teardown"].invoke
8 Rake::Task["ci:teardown"].invoke
9 end
9 end
10
10
11 namespace :ci do
11 namespace :ci do
12 desc "Setup Redmine for a new build"
12 desc "Setup Redmine for a new build"
13 task :setup do
13 task :setup do
14 Rake::Task["tmp:clear"].invoke
14 Rake::Task["tmp:clear"].invoke
15 Rake::Task["log:clear"].invoke
15 Rake::Task["log:clear"].invoke
16 Rake::Task["db:create:all"].invoke
16 Rake::Task["db:create:all"].invoke
17 Rake::Task["db:migrate"].invoke
17 Rake::Task["db:migrate"].invoke
18 Rake::Task["db:schema:dump"].invoke
18 Rake::Task["db:schema:dump"].invoke
19 if scms = ENV['SCMS']
19 if scms = ENV['SCMS']
20 scms.split(',').each do |scm|
20 scms.split(',').each do |scm|
21 Rake::Task["test:scm:setup:#{scm}"].invoke
21 Rake::Task["test:scm:setup:#{scm}"].invoke
22 end
22 end
23 else
23 else
24 Rake::Task["test:scm:setup:all"].invoke
24 Rake::Task["test:scm:setup:all"].invoke
25 end
25 end
26 Rake::Task["test:scm:update"].invoke
26 Rake::Task["test:scm:update"].invoke
27 end
27 end
28
28
29 desc "Build Redmine"
29 desc "Build Redmine"
30 task :build do
30 task :build do
31 if test_suite = ENV['TEST_SUITE']
31 if test_suite = ENV['TEST_SUITE']
32 Rake::Task["test:#{test_suite}"].invoke
32 Rake::Task["test:#{test_suite}"].invoke
33 else
33 else
34 Rake::Task["test"].invoke
34 Rake::Task["test"].invoke
35 end
35 end
36 # Rake::Task["test:ui"].invoke if RUBY_VERSION >= '1.9.3'
36 # Rake::Task["test:ui"].invoke if RUBY_VERSION >= '1.9.3'
37 end
37 end
38
38
39 desc "Finish the build"
39 desc "Finish the build"
40 task :teardown do
40 task :teardown do
41 end
41 end
42 end
42 end
43
43
44 desc "Creates database.yml for the CI server"
44 desc "Creates database.yml for the CI server"
45 file 'config/database.yml' do
45 file 'config/database.yml' do
46 require 'yaml'
46 require 'yaml'
47 database = ENV['DATABASE_ADAPTER']
47 database = ENV['DATABASE_ADAPTER']
48 ruby = ENV['RUBY_VER'].gsub('.', '').gsub('-', '')
48 ruby = ENV['RUBY_VER'].gsub('.', '').gsub('-', '')
49 branch = ENV['BRANCH'].gsub('.', '').gsub('-', '')
49 branch = ENV['BRANCH'].gsub('.', '').gsub('-', '')
50 dev_db_name = "ci_#{branch}_#{ruby}_dev"
50 dev_db_name = "ci_#{branch}_#{ruby}_dev"
51 test_db_name = "ci_#{branch}_#{ruby}_test"
51 test_db_name = "ci_#{branch}_#{ruby}_test"
52
52
53 case database
53 case database
54 when 'mysql'
54 when 'mysql'
55 dev_conf = {'adapter' => (RUBY_VERSION >= '1.9' ? 'mysql2' : 'mysql'),
55 dev_conf = {'adapter' => (RUBY_VERSION >= '1.9' ? 'mysql2' : 'mysql'),
56 'database' => dev_db_name, 'host' => 'localhost',
56 'database' => dev_db_name, 'host' => 'localhost',
57 'encoding' => 'utf8'}
57 'encoding' => 'utf8'}
58 if ENV['RUN_ON_NOT_OFFICIAL']
58 if ENV['RUN_ON_NOT_OFFICIAL']
59 dev_conf['username'] = 'root'
59 dev_conf['username'] = 'root'
60 else
60 else
61 dev_conf['username'] = 'jenkins'
61 dev_conf['username'] = 'jenkins'
62 dev_conf['password'] = 'jenkins'
62 dev_conf['password'] = 'jenkins'
63 end
63 end
64 test_conf = dev_conf.merge('database' => test_db_name)
64 test_conf = dev_conf.merge('database' => test_db_name)
65 when 'postgresql'
65 when /postgresql/
66 dev_conf = {'adapter' => 'postgresql', 'database' => dev_db_name,
66 dev_conf = {'adapter' => 'postgresql', 'database' => dev_db_name,
67 'host' => 'localhost'}
67 'host' => 'localhost'}
68 if ENV['RUN_ON_NOT_OFFICIAL']
68 if ENV['RUN_ON_NOT_OFFICIAL']
69 dev_conf['username'] = 'postgres'
69 dev_conf['username'] = 'postgres'
70 else
70 else
71 dev_conf['username'] = 'jenkins'
71 dev_conf['username'] = 'jenkins'
72 dev_conf['password'] = 'jenkins'
72 dev_conf['password'] = 'jenkins'
73 end
73 end
74 test_conf = dev_conf.merge('database' => test_db_name)
74 test_conf = dev_conf.merge('database' => test_db_name)
75 when /sqlite3/
75 when /sqlite3/
76 dev_conf = {'adapter' => (Object.const_defined?(:JRUBY_VERSION) ?
76 dev_conf = {'adapter' => (Object.const_defined?(:JRUBY_VERSION) ?
77 'jdbcsqlite3' : 'sqlite3'),
77 'jdbcsqlite3' : 'sqlite3'),
78 'database' => "db/#{dev_db_name}.sqlite3"}
78 'database' => "db/#{dev_db_name}.sqlite3"}
79 test_conf = dev_conf.merge('database' => "db/#{test_db_name}.sqlite3")
79 test_conf = dev_conf.merge('database' => "db/#{test_db_name}.sqlite3")
80 when 'sqlserver'
80 when 'sqlserver'
81 dev_conf = {'adapter' => 'sqlserver', 'database' => dev_db_name,
81 dev_conf = {'adapter' => 'sqlserver', 'database' => dev_db_name,
82 'host' => 'mssqlserver', 'port' => 1433,
82 'host' => 'mssqlserver', 'port' => 1433,
83 'username' => 'jenkins', 'password' => 'jenkins'}
83 'username' => 'jenkins', 'password' => 'jenkins'}
84 test_conf = dev_conf.merge('database' => test_db_name)
84 test_conf = dev_conf.merge('database' => test_db_name)
85 else
85 else
86 abort "Unknown database"
86 abort "Unknown database"
87 end
87 end
88
88
89 File.open('config/database.yml', 'w') do |f|
89 File.open('config/database.yml', 'w') do |f|
90 f.write YAML.dump({'development' => dev_conf, 'test' => test_conf})
90 f.write YAML.dump({'development' => dev_conf, 'test' => test_conf})
91 end
91 end
92 end
92 end
General Comments 0
You need to be logged in to leave comments. Login now