diff lib/tasks/ci.rake @ 1516:b450a9d58aed redmine-2.4

Update to Redmine SVN revision 13356 on 2.4-stable branch
author Chris Cannam
date Tue, 09 Sep 2014 09:28:31 +0100
parents 261b3d9a4903
children dffacf8a6908
line wrap: on
line diff
--- a/lib/tasks/ci.rake	Mon Mar 17 08:54:02 2014 +0000
+++ b/lib/tasks/ci.rake	Tue Sep 09 09:28:31 2014 +0100
@@ -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 @@
     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 @@
   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) ?