diff --git a/.rubocop.yml b/.rubocop.yml index 64ca6694..6ca3d9ae 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -9,7 +9,7 @@ AllCops: Style/AsciiComments: Enabled: false -Documentation: +Style/Documentation: Enabled: false Style/ClassAndModuleChildren: @@ -34,6 +34,7 @@ Metrics/BlockLength: Exclude: - "test/factories/*" - "config/**/*" + - "lib/tasks/*.rake" Metrics/AbcSize: Max: 40 diff --git a/config/environments/production.rb b/config/environments/production.rb index f1ef9e0c..fb51587a 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -75,7 +75,7 @@ # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new "app-name") if ENV['RAILS_LOG_TO_STDOUT'].present? - logger = ActiveSupport::Logger.new(STDOUT) + logger = ActiveSupport::Logger.new($stdout) logger.formatter = config.log_formatter config.logger = ActiveSupport::TaggedLogging.new(logger) end diff --git a/lib/tasks/visual_regression_test.rake b/lib/tasks/visual_regression_test.rake index 9b40726e..6827993f 100644 --- a/lib/tasks/visual_regression_test.rake +++ b/lib/tasks/visual_regression_test.rake @@ -33,17 +33,18 @@ namespace :visual_regression_test do current_ref = `git rev-parse HEAD`.strip base_branch = ENV.fetch('BASE_BRANCH', 'master').strip base_ref = `git rev-parse #{base_branch}`.strip - + before_dir = File.join('tmp', "visual_regression_test_auto_#{base_ref}") after_dir = File.join('tmp', "visual_regression_test_auto_#{current_ref}") - compare_dir = File.join('tmp', "visual_regression_test_auto_compare") + compare_dir = File.join('tmp', 'visual_regression_test_auto_compare') - fork do + pid = fork do ENV['OUTPUT_DIR'] = after_dir Rake::Task['visual_regression_test:take_screenshot'].invoke - end.tap { |pid| Process.wait pid } + end + Process.wait pid - fork do + pid = fork do _system("git checkout #{base_branch}") _system('bundle install') @@ -51,14 +52,16 @@ namespace :visual_regression_test do Rake::Task['visual_regression_test:take_screenshot'].invoke ensure _system("git checkout #{current_branch}") - end.tap { |pid| Process.wait pid } + end + Process.wait pid - fork do + pid = fork do ENV['BEFORE_DIR'] = before_dir ENV['AFTER_DIR'] = after_dir ENV['OUTPUT_DIR'] = compare_dir Rake::Task['visual_regression_test:compare'].invoke - end.tap { |pid| Process.wait pid } + end + Process.wait pid end end