Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/lib/generators/spree/dummy/dummy_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def generate_test_dummy
opts[:skip_javascript] = true
opts[:skip_action_cable] = true

puts "Generating dummy Rails application..."
say "Generating dummy Rails application..."
invoke Rails::Generators::AppGenerator,
[File.expand_path(dummy_path, destination_root)], opts
end
Expand Down
7 changes: 4 additions & 3 deletions core/lib/spree/testing_support/common_rake.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class CommonRakeTasks
include Rake::DSL

def initialize
Rails.logger ||= Logger.new($stdout)
namespace :common do
task :test_app, :user_class do |_t, args|
args.with_defaults(user_class: "Spree::LegacyUser")
Expand Down Expand Up @@ -45,19 +46,19 @@ def initialize
sh "bin/rails g solidus_frontend:install --auto-accept"
end

puts "Setting up dummy database..."
Rails.logger.info "Setting up dummy database..."

sh "bin/rails db:environment:set RAILS_ENV=test"
sh "bin/rails db:drop db:create db:migrate VERBOSE=false RAILS_ENV=test"

if extension_installation_generator_exists?
puts 'Running extension installation generator...'
Rails.logger.info 'Running extension installation generator...'
sh "bin/rails generate #{rake_generator_namespace}:install --auto-run-migrations"
end
end

task :seed do |_t, _args|
puts "Seeding ..."
Rails.logger.info "Seeding ..."

sh "bundle exec rake db:seed RAILS_ENV=test"
end
Expand Down
1 change: 1 addition & 0 deletions core/lib/spree/testing_support/dummy_app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
require 'active_storage/engine'

Rails.env = 'test'
Rails.logger ||= Logger.new($stdout)

require 'solidus_core'

Expand Down
4 changes: 2 additions & 2 deletions core/lib/spree/testing_support/dummy_app/migrations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module Migrations

def auto_migrate
if needs_migration?
puts "Configuration changed. Re-running migrations"
Rails.logger.info "Configuration changed. Re-running migrations"

# Disconnect to avoid "database is being accessed by other users" on postgres
ActiveRecord::Base.remove_connection
Expand All @@ -29,7 +29,7 @@ def needs_migration?
end

def sh(cmd)
puts cmd
Rails.logger.info cmd
system cmd
end
end
Expand Down
4 changes: 2 additions & 2 deletions core/lib/spree/testing_support/translations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ module Translations
def check_missing_translations(page, example)
missing_translations = page.body.scan(/translation missing: #{I18n.locale}\.(.*?)[\s<\"&]/)
if missing_translations.any?
puts "Found missing translations: #{missing_translations.inspect}"
puts "In spec: #{example.location}"
Rails.logger.info "Found missing translations: #{missing_translations.inspect}"
Rails.logger.info "In spec: #{example.location}"
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def run_migrations
if run_migrations
run "bin/rails db:migrate"
else
puts "Skipping bin/rails db:migrate, don't forget to run it!"
Rails.logger.info "Skipping bin/rails db:migrate, don't forget to run it!"
end
end

Expand Down
4 changes: 2 additions & 2 deletions promotions/lib/solidus_promotions/promotion_migrator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def copy_promotion(old_promotion)
def generate_new_benefits(old_promotion_action)
promo_action_config = promotion_map[:actions][old_promotion_action.class]
if promo_action_config.nil?
puts("#{old_promotion_action.class} is not supported")
Rails.logger.info("#{old_promotion_action.class} is not supported")
return nil
end
promo_action_config.call(old_promotion_action)
Expand All @@ -87,7 +87,7 @@ def generate_new_benefits(old_promotion_action)
def generate_new_promotion_conditions(old_promotion_rule)
new_promo_condition_class = promotion_map[:conditions][old_promotion_rule.class]
if new_promo_condition_class.nil?
puts("#{old_promotion_rule.class} is not supported")
Rails.logger.info("#{old_promotion_rule.class} is not supported")
[]
elsif new_promo_condition_class.respond_to?(:call)
new_promo_condition_class.call(old_promotion_rule)
Expand Down