From 6c721f2e245c8428dac90b0dae2b00630988d7ce Mon Sep 17 00:00:00 2001 From: Tony Hsu Date: Mon, 11 Nov 2024 17:29:02 +0100 Subject: [PATCH] Check missing deps --- Rakefile | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Rakefile b/Rakefile index aa67152a83..2ff9cc12dd 100644 --- a/Rakefile +++ b/Rakefile @@ -56,13 +56,13 @@ namespace :test do end candidates.each do |appraisal_group, _| - command = if appraisal_group.empty? - "bundle exec rake #{spec_task}" - else - gemfile = File.join(File.dirname(__FILE__), 'gemfiles', "#{ruby_runtime}-#{appraisal_group}.gemfile".tr('-', '_')) - "env BUNDLE_GEMFILE=#{gemfile} bundle exec rake #{spec_task}" - end - + env = if appraisal_group.empty? + {} + else + gemfile = File.join(File.dirname(__FILE__), 'gemfiles', "#{ruby_runtime}-#{appraisal_group}.gemfile".tr('-', '_')) + { 'BUNDLE_GEMFILE' => gemfile } + end + command = "bundle check || bundle install && bundle exec rake #{spec_task}" command += "'[#{spec_arguments}]'" if spec_arguments total_executors = ENV.key?('CIRCLE_NODE_TOTAL') ? ENV['CIRCLE_NODE_TOTAL'].to_i : nil @@ -71,9 +71,9 @@ namespace :test do if total_executors && current_executor && total_executors > 1 @execution_count ||= 0 @execution_count += 1 - sh(command) if @execution_count % total_executors == current_executor + Bundler.with_unbundled_env { sh(env, command) } if @execution_count % total_executors == current_executor else - sh(command) + Bundler.with_unbundled_env { sh(env, command) } end end end