Skip to content

Commit

Permalink
fixcop
Browse files Browse the repository at this point in the history
  • Loading branch information
genya0407 committed Mar 11, 2022
1 parent d12eaf7 commit 5175768
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ AllCops:
Style/AsciiComments:
Enabled: false

Documentation:
Style/Documentation:
Enabled: false

Style/ClassAndModuleChildren:
Expand All @@ -34,6 +34,7 @@ Metrics/BlockLength:
Exclude:
- "test/factories/*"
- "config/**/*"
- "lib/tasks/*.rake"

Metrics/AbcSize:
Max: 40
Expand Down
2 changes: 1 addition & 1 deletion config/environments/production.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
19 changes: 11 additions & 8 deletions lib/tasks/visual_regression_test.rake
Original file line number Diff line number Diff line change
Expand Up @@ -33,32 +33,35 @@ 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')

ENV['OUTPUT_DIR'] = before_dir
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

0 comments on commit 5175768

Please sign in to comment.