From 5b5b6fa330100f97652f442831eee934e931fec7 Mon Sep 17 00:00:00 2001 From: Eric Schultz Date: Thu, 16 Apr 2020 14:17:57 -0500 Subject: [PATCH] Add support for parallel_tests --- .rspec_parallel | 2 ++ Gemfile | 1 + Gemfile.lock | 3 +++ config/database.yml | 2 +- config/environments/test.rb | 3 +++ spec/spec_helper.rb | 3 +++ 6 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 .rspec_parallel diff --git a/.rspec_parallel b/.rspec_parallel new file mode 100644 index 00000000..54b33804 --- /dev/null +++ b/.rspec_parallel @@ -0,0 +1,2 @@ +--format progress +--format ParallelTests::RSpec::SummaryLogger --out tmp/spec_summary.log diff --git a/Gemfile b/Gemfile index 7aafa25f..4a43175c 100755 --- a/Gemfile +++ b/Gemfile @@ -95,6 +95,7 @@ group :development, :ci, :test do gem 'standard', '~> 0.1.2' gem 'rspec-rails', '~> 3.8', '>= 3.8.2' gem 'rspec', '~> 3.8' + gem 'parallel_tests', '~> 2.32' end group :ci, :test do diff --git a/Gemfile.lock b/Gemfile.lock index d0f83275..eede3424 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -311,6 +311,8 @@ GEM mini_portile2 (~> 2.4.0) orm_adapter (0.5.0) parallel (1.17.0) + parallel_tests (2.32.0) + parallel parser (2.6.3.0) ast (~> 2.4.0) pg (0.21.0) @@ -547,6 +549,7 @@ DEPENDENCIES mini_magick (~> 4.9) nearest_time_zone (~> 0.0.4) parallel (~> 1.17) + parallel_tests (~> 2.32) param_validation! pg (~> 0.11) pry (~> 0.12.2) diff --git a/config/database.yml b/config/database.yml index f1c38484..556f7a58 100755 --- a/config/database.yml +++ b/config/database.yml @@ -25,7 +25,7 @@ development: test: adapter: postgresql encoding: unicode - database: commitchange_test + database: houdini_test<%= ENV['TEST_ENV_NUMBER'] %> pool: 5 username: houdini_user password: password diff --git a/config/environments/test.rb b/config/environments/test.rb index 89d2ed0e..c5b99319 100755 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -45,4 +45,7 @@ Commitchange::Application.configure do # Raises error for missing translations # config.action_view.raise_on_missing_translations = true + + #recommended by https://github.com/grosser/parallel_tests/wiki + config.cache_store = :file_store, Rails.root.join("tmp", "cache", "paralleltests#{ENV['TEST_ENV_NUMBER']}") end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 7120c71c..a486730c 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -115,4 +115,7 @@ RSpec.configure do |config| end config.include(Wisper::RSpec::BroadcastMatcher) + + # mute noise for parallel tests + config.silence_filter_announcements = true if ENV['TEST_ENV_NUMBER'] end