Added support parallel_tests (#2740)

- Added new gem the `parallel_tests`.
- Updated .travis.yml.
  - Improved scripts and environment variable.
shrike
Keiji Matsuzaki 2017-05-03 19:20:38 +09:00 committed by Eugen Rochko
parent 38473f0aa0
commit 90c00f075a
4 changed files with 12 additions and 4 deletions

View File

@ -14,6 +14,9 @@ env:
- LOCAL_HTTPS=true - LOCAL_HTTPS=true
- RAILS_ENV=test - RAILS_ENV=test
- CXX=g++-4.8 - CXX=g++-4.8
- NOKOGIRI_USE_SYSTEM_LIBRARIES=true
- PARALLEL_TEST_PROCESSORS=2
addons: addons:
postgresql: 9.4 postgresql: 9.4
apt: apt:
@ -31,7 +34,7 @@ rvm:
services: services:
- redis-server - redis-server
bundler_args: --without development production --retry=3 --jobs=3 bundler_args: --without development production --retry=3 --jobs=16
install: install:
- nvm install - nvm install
@ -40,10 +43,10 @@ install:
- yarn install - yarn install
before_script: 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 - bundle exec rails assets:precompile
script: script:
- bundle exec rspec - bundle exec parallel_test spec/ --group-by filesize --type rspec
- npm test - npm test
- i18n-tasks unused - i18n-tasks unused

View File

@ -77,6 +77,7 @@ group :test do
gem 'rspec-sidekiq' gem 'rspec-sidekiq'
gem 'simplecov', require: false gem 'simplecov', require: false
gem 'webmock' gem 'webmock'
gem 'parallel_tests'
end end
group :development do group :development do

View File

@ -270,6 +270,9 @@ GEM
paperclip-av-transcoder (0.6.4) paperclip-av-transcoder (0.6.4)
av (~> 0.9.0) av (~> 0.9.0)
paperclip (>= 2.5.2) paperclip (>= 2.5.2)
parallel (1.11.1)
parallel_tests (2.14.1)
parallel
parser (2.4.0.0) parser (2.4.0.0)
ast (~> 2.2) ast (~> 2.2)
pg (0.20.0) pg (0.20.0)
@ -510,6 +513,7 @@ DEPENDENCIES
ox ox
paperclip (~> 5.1) paperclip (~> 5.1)
paperclip-av-transcoder paperclip-av-transcoder
parallel_tests
pg pg
pghero pghero
pkg-config pkg-config

View File

@ -13,7 +13,7 @@ development:
# Do not set this db to the same as development or production. # Do not set this db to the same as development or production.
test: test:
<<: *default <<: *default
database: mastodon_test database: mastodon_test<%= ENV['TEST_ENV_NUMBER'] %>
production: production:
<<: *default <<: *default