From d4319127907358c43187a81e9810b363506279fc Mon Sep 17 00:00:00 2001 From: Ryan Davis Date: Thu, 17 Oct 2019 11:44:35 -0700 Subject: [PATCH] Switched parallel worker env var from N to K. Fixed windows parallel runs. Signed-off-by: Ryan Davis --- Rakefile | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Rakefile b/Rakefile index 9d1b0fed0..3b8d5815c 100755 --- a/Rakefile +++ b/Rakefile @@ -89,6 +89,7 @@ namespace :test do # rubocop:disable Style/BlockDelimiters,Layout/ExtraSpacing,Lint/AssignmentInCondition def n_threads_run(n_workers, jobs) + require "thread" queue = Queue.new jobs.each do |job| @@ -157,21 +158,19 @@ namespace :test do task :isolated do require "fileutils" - require "thread" # Only needed for local runs, not CI? FileUtils.rm_rf File.expand_path "~/.inspec" FileUtils.rm_rf File.expand_path "~/.chef" # 3 seems to be the magic number... (tho not by that much) - bad, good, n = {}, [], (ENV.delete("N") || 3).to_i + bad, good, n = {}, [], (ENV.delete("K") || 3).to_i t0 = Time.now - srand 42 tests = Dir[*GLOBS].sort n_threads_run n, tests do |path| - output = `bundle exec ruby -Ilib:test #{path} 2>&1` + output = `bundle exec ruby -Ilib -Itest #{path} 2>&1` if $?.success? $stderr.print "."