@@ -0,0 +1,37 | |||||
|
1 | # Redmine runs tests on own continuous integration server. | |||
|
2 | # http://www.redmine.org/projects/redmine/wiki/Continuous_integration | |||
|
3 | # You can also run tests on your environment. | |||
|
4 | language: ruby | |||
|
5 | rvm: | |||
|
6 | - 1.8.7 | |||
|
7 | - 1.9.3 | |||
|
8 | - 2.0 | |||
|
9 | - jruby | |||
|
10 | matrix: | |||
|
11 | allow_failures: | |||
|
12 | # SCM tests fail randomly due to IO.popen(). | |||
|
13 | # https://github.com/jruby/jruby/issues/779 | |||
|
14 | - rvm: jruby | |||
|
15 | env: | |||
|
16 | - "TEST_SUITE=units DATABASE_ADAPTER=postgresql" | |||
|
17 | - "TEST_SUITE=functionals DATABASE_ADAPTER=postgresql" | |||
|
18 | - "TEST_SUITE=integration DATABASE_ADAPTER=postgresql" | |||
|
19 | - "TEST_SUITE=units DATABASE_ADAPTER=mysql" | |||
|
20 | - "TEST_SUITE=functionals DATABASE_ADAPTER=mysql" | |||
|
21 | - "TEST_SUITE=integration DATABASE_ADAPTER=mysql" | |||
|
22 | - "TEST_SUITE=units DATABASE_ADAPTER=sqlite3" | |||
|
23 | - "TEST_SUITE=functionals DATABASE_ADAPTER=sqlite3" | |||
|
24 | - "TEST_SUITE=integration DATABASE_ADAPTER=sqlite3" | |||
|
25 | before_install: | |||
|
26 | - "sudo apt-get update -qq" | |||
|
27 | - "sudo apt-get --no-install-recommends install bzr cvs git mercurial subversion" | |||
|
28 | script: | |||
|
29 | - "SCMS=bazaar,cvs,subversion,git,mercurial,filesystem" | |||
|
30 | - "export SCMS" | |||
|
31 | - "git --version" | |||
|
32 | - "bundle install" | |||
|
33 | - "RUN_ON_NOT_OFFICIAL='' RUBY_VER=1.9 BRANCH=trunk bundle exec rake config/database.yml" | |||
|
34 | - "bundle install" | |||
|
35 | - "JRUBY_OPTS=-J-Xmx1024m bundle exec rake ci" | |||
|
36 | notifications: | |||
|
37 | email: false |
@@ -1,4 +1,4 | |||||
1 | desc "Run the Continous 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' | |
@@ -16,13 +16,23 namespace :ci do | |||||
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 | Rake::Task["test:scm:setup:all"].invoke |
|
19 | if scms = ENV['SCMS'] | |
|
20 | scms.split(',').each do |scm| | |||
|
21 | Rake::Task["test:scm:setup:#{scm}"].invoke | |||
|
22 | end | |||
|
23 | else | |||
|
24 | Rake::Task["test:scm:setup:all"].invoke | |||
|
25 | end | |||
20 | Rake::Task["test:scm:update"].invoke |
|
26 | Rake::Task["test:scm:update"].invoke | |
21 | end |
|
27 | end | |
22 |
|
28 | |||
23 | desc "Build Redmine" |
|
29 | desc "Build Redmine" | |
24 | task :build do |
|
30 | task :build do | |
25 | Rake::Task["test"].invoke |
|
31 | if test_suite = ENV['TEST_SUITE'] | |
|
32 | Rake::Task["test:#{test_suite}"].invoke | |||
|
33 | else | |||
|
34 | Rake::Task["test"].invoke | |||
|
35 | end | |||
26 | # Rake::Task["test:ui"].invoke if RUBY_VERSION >= '1.9.3' |
|
36 | # Rake::Task["test:ui"].invoke if RUBY_VERSION >= '1.9.3' | |
27 | end |
|
37 | end | |
28 |
|
38 | |||
@@ -43,14 +53,24 file 'config/database.yml' do | |||||
43 | case database |
|
53 | case database | |
44 | when 'mysql' |
|
54 | when 'mysql' | |
45 | dev_conf = {'adapter' => (RUBY_VERSION >= '1.9' ? 'mysql2' : 'mysql'), |
|
55 | dev_conf = {'adapter' => (RUBY_VERSION >= '1.9' ? 'mysql2' : 'mysql'), | |
46 | 'database' => dev_db_name, 'host' => 'localhost', |
|
56 | 'database' => dev_db_name, 'host' => 'localhost', | |
47 | 'username' => 'jenkins', 'password' => 'jenkins', |
|
57 | 'encoding' => 'utf8'} | |
48 | 'encoding' => 'utf8'} |
|
58 | if ENV['RUN_ON_NOT_OFFICIAL'] | |
|
59 | dev_conf['username'] = 'root' | |||
|
60 | else | |||
|
61 | dev_conf['username'] = 'jenkins' | |||
|
62 | dev_conf['password'] = 'jenkins' | |||
|
63 | end | |||
49 | test_conf = dev_conf.merge('database' => test_db_name) |
|
64 | test_conf = dev_conf.merge('database' => test_db_name) | |
50 | when 'postgresql' |
|
65 | when 'postgresql' | |
51 | dev_conf = {'adapter' => 'postgresql', 'database' => dev_db_name, |
|
66 | dev_conf = {'adapter' => 'postgresql', 'database' => dev_db_name, | |
52 |
'host' => 'localhost' |
|
67 | 'host' => 'localhost'} | |
53 | 'username' => 'jenkins', 'password' => 'jenkins'} |
|
68 | if ENV['RUN_ON_NOT_OFFICIAL'] | |
|
69 | dev_conf['username'] = 'postgres' | |||
|
70 | else | |||
|
71 | dev_conf['username'] = 'jenkins' | |||
|
72 | dev_conf['password'] = 'jenkins' | |||
|
73 | end | |||
54 | test_conf = dev_conf.merge('database' => test_db_name) |
|
74 | test_conf = dev_conf.merge('database' => test_db_name) | |
55 | when /sqlite3/ |
|
75 | when /sqlite3/ | |
56 | dev_conf = {'adapter' => (Object.const_defined?(:JRUBY_VERSION) ? |
|
76 | dev_conf = {'adapter' => (Object.const_defined?(:JRUBY_VERSION) ? |
General Comments 0
You need to be logged in to leave comments.
Login now