about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml9
-rw-r--r--Gemfile1
-rw-r--r--Gemfile.lock4
-rw-r--r--config/database.yml2
4 files changed, 12 insertions, 4 deletions
diff --git a/.travis.yml b/.travis.yml
index 58be0908f..015acd468 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -14,6 +14,9 @@ env:
     - LOCAL_HTTPS=true
     - RAILS_ENV=test
     - CXX=g++-4.8
+    - NOKOGIRI_USE_SYSTEM_LIBRARIES=true
+    - PARALLEL_TEST_PROCESSORS=2
+
 addons:
   postgresql: 9.4
   apt:
@@ -31,7 +34,7 @@ rvm:
 services:
   - redis-server
 
-bundler_args: --without development production --retry=3 --jobs=3
+bundler_args: --without development production --retry=3 --jobs=16
 
 install:
   - nvm install
@@ -40,10 +43,10 @@ install:
   - yarn install
 
 before_script:
-  - bundle exec rails db:create db:schema:load
+  - bundle exec rake parallel:create parallel:load_schema parallel:prepare
   - bundle exec rails assets:precompile
 
 script:
-  - bundle exec rspec
+  - bundle exec parallel_test spec/ --group-by filesize --type rspec
   - npm test
   - i18n-tasks unused
diff --git a/Gemfile b/Gemfile
index 8009e2cbe..1287afe44 100644
--- a/Gemfile
+++ b/Gemfile
@@ -77,6 +77,7 @@ group :test do
   gem 'rspec-sidekiq'
   gem 'simplecov', require: false
   gem 'webmock'
+  gem 'parallel_tests'
 end
 
 group :development do
diff --git a/Gemfile.lock b/Gemfile.lock
index ab811bcfd..218e17237 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -270,6 +270,9 @@ GEM
     paperclip-av-transcoder (0.6.4)
       av (~> 0.9.0)
       paperclip (>= 2.5.2)
+    parallel (1.11.1)
+    parallel_tests (2.14.1)
+      parallel
     parser (2.4.0.0)
       ast (~> 2.2)
     pg (0.20.0)
@@ -510,6 +513,7 @@ DEPENDENCIES
   ox
   paperclip (~> 5.1)
   paperclip-av-transcoder
+  parallel_tests
   pg
   pghero
   pkg-config
diff --git a/config/database.yml b/config/database.yml
index 810b83278..39393e93a 100644
--- a/config/database.yml
+++ b/config/database.yml
@@ -13,7 +13,7 @@ development:
 # Do not set this db to the same as development or production.
 test:
   <<: *default
-  database: mastodon_test
+  database: mastodon_test<%= ENV['TEST_ENV_NUMBER'] %>
 
 production:
   <<: *default